cups-pdf requires user to create output folder before working correctly.

Bug #295318 reported by Doug Barrett
176
This bug affects 30 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Invalid
Undecided
Unassigned
apparmor (Ubuntu)
Fix Released
Undecided
Unassigned
cups-pdf (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: cups-pdf

Installing cups-pdf does not create a ~/PDF folder in the user directory. If you don't create the directory manually, the PDF printer does not work. I would think that cups-pdf should create the directory when it is installed.

I'm running Ubuntu 8.10 with a fully updated system as of November 7th at 12:29 PM PST.

Tags: bitesize
Revision history for this message
j3f0 (tevelized) wrote :

I can confirm the same Bug

Linux username-laptop 2.6.27-7-generic #1 SMP Tue Nov 4 19:33:06 UTC 2008 x86_64 GNU/Linux

Revision history for this message
papukaija (papukaija) wrote :

I can also confirm this bug. Marking this bug as confirmed.

Changed in cups-pdf:
status: New → Confirmed
Revision history for this message
Patrick Kilgore (patrick-kilgore) wrote :

This bug is easily worked around by creating the /home/$USER/PDF folder yourself. If you create the folder and you still are not able to use cups-pdf, bug 295536 may be of interest to you.

FYI, this work around is working in 8.10 for me. Thanks for the bug report.

Changed in cups-pdf:
importance: Undecided → Low
Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote : Re: cups-pdf requires user to create output folder in 8.10 before working correctly.

There is some information relevant to this issue in Bug #134682. I was about to propose that we change the default to a directory like Desktop or Documents which come as default on an Ubuntu install and we can assume the user will have, unlike PDF. Unfortunately, cups-pdf's configuration doesn't understand things like
"XDG_DESKTOP_DIR" so we run into issues with locales. We shouldn't be hard-codeing one language as that would break all others.

Revision history for this message
Johan Ehnberg (johan-ehnberg) wrote :

Confirmed. Workaround works. Ubuntu 8.10 i386.

Revision history for this message
papukaija (papukaija) wrote :

Is this bug fixed in Jaunty?

Revision history for this message
Jeff Campbell (jeff-soupbowl) wrote :

Confirmed Still busted in Jaunty-beta. Workaround works.

Revision history for this message
MyR (myr-jedi) wrote :

Why is this of low importance? The bug causes the package not to work at all.

Revision history for this message
Attila Franczen (marrow) wrote :

I tried to make a patch to solve the issue, but I got stuck. I wrote an email to the upstream author of cups-pdf Volker C. Behr. He pointed out some issue: and after checking his suggestions, it seems that one of his hunch is the winner: it is AppArmor. Try:
1. Delete the PDF directory, then try to print. Won't work, as mentioned above.
2. Stop AppArmor (sudo /etc/init.d/apparmor stop), and try to print again. PDF directory gets created, and everything is fine.

I have no clue what it is in AppArmor config, that causes this (I have very little knowledge of AppArmor), so this is beyond me. I guess this is an AppArmor bug.

P.S.: Just for the record, Volker C. Behr replied in 20 minutes after I wrote the mail to him. So cheers and thanks to him from here too.

Rgds,
Attila

Revision history for this message
Martin-Éric Racine (q-funk) wrote :

The situation with AppArmor is a known issue that has been documented in /usr/share/doc/cups-pdf/README.Debian for quite some time already. Previously, it only prevented outputing documents to non-standard directories. Recently, it also started to prevent the initial creation of the standard PDF directory under ${HOME}.

Revision history for this message
MyR (myr-jedi) wrote :

Why don't you change the default output direcory to the home dir instead? Sounds like it will avoid apparmor and locale issues.

Revision history for this message
Julian Lam (julian-lam) wrote :

I can confirm that this bug occurs in Jaunty as well.

Revision history for this message
asklin (monde-email) wrote :

I can also confirm the bug in Jaunty (stable).

Revision history for this message
kassx (cosine7) (oliver-higgins) wrote :

+1 Jaunty.

Revision history for this message
RomD (romd) wrote :

Same problem on Jaunty.
I agree with MyR, this bug should have a higher priority.
There isn't any warning or error message, so many users won't know why printing to PDF didn't work.

Revision history for this message
Attila Franczen (marrow) wrote :

My suggestion would be to change the binary-package of this bug from cups-pdf to apparmor, because I think this is an apparmor bug.

Revision history for this message
Chris B (billington-chris) wrote :

Confirmed still a problem with a new install of Jaunty.

cups-pdf 2.5.0-1ubuntu1 PDF printer for CUPS

The failure to write to the ~./PDF directory can be confirmed with tail /var/log/cups/cups_pdf.log
mkdir .PDF from users home directory resolves.

Apparmor audit entry says:
kernel: [ 1938.022085] type=1503 audit(1243933166.961:11): operation="capable" name="dac_override" pid=4553 profile="/usr/lib/cups/backend/cups-pdf"

the Apparmor profile /etc/apparmor.d/usr.sbin.cupsd contains:

  # we treat cups-pdf specially, since it needs to write into /home
  # and thus needs extra paranoia
  /usr/lib/cups/backend/cups-pdf Px,
# separate profile since this needs to write into /home
/usr/lib/cups/backend/cups-pdf {
  #include <abstractions/base>
  #include <abstractions/fonts>
  #include <abstractions/nameservice>
  #include <abstractions/user-tmp>

  capability chown,
  capability fowner,
  capability fsetid,
  capability setgid,
  capability setuid,

  /bin/dash ixr,
  /bin/bash ixr,
  /etc/papersize r,
  /etc/cups/cups-pdf.conf r,
  @{HOME}/PDF/ rw,
  @{HOME}/PDF/* rw,
  /usr/bin/gs ixr,
  /usr/lib/cups/backend/cups-pdf mr,
  /usr/lib/ghostscript/** mr,
  /usr/share/** r,
  /var/log/cups/cups-pdf_log w,
  /var/spool/cups-pdf/** rw,
}

It would seem that there are rules to allow writing to ~./PDF and ~./PDF/*, but they are not working. I was not able to work out why.

This is a trivial problem for experienced users to solve, but as a usability issue for non-technical users it deserves a higher priority.

While there is an out-of-box alternative 'print to file', select 'pdf' format, this may not be intuitive or clear for new users, as the documentation at https://help.ubuntu.com/community/PDFPrinting?action=show&redirect=PrintToPDF is outdated and only mentions the cups-pdf method. I will try and update it.

summary: - cups-pdf requires user to create output folder in 8.10 before working
- correctly.
+ cups-pdf requires user to create output folder before working correctly.
Revision history for this message
papukaija (papukaija) wrote :

Is this bug fixed in Karmic?

Revision history for this message
ward (ward-pong) wrote :

On Jaunty, apparmor prevents cups-pdf from working. I have a ~/PDF folder, but unless I shut down apparmor cups-pdf print jobs just disappear, with this error in the logs:

  [ERROR] failed to set file mode for PDF file (non fatal)

So, creating ~/PDF is *not* sufficient to solve this...

Revision history for this message
BrowneR (chris-scotland) wrote :

I can confirm what ward says in Jaunty.

"creating ~/PDF is *not* sufficient to solve this"

AppArmor is still preventing printing therefore the title of this bug report is misleading.

Revision history for this message
Sebastian Geiger (lanoxx) wrote : Re: [Bug 295318] Re: cups-pdf requires user to create output folder before working correctly.

Yes, thats completely right. The only way to fix this is to either
reconfigure the apparmor script in /etc/apparmor/ or tell cups to ignore
cups-pdf. This is not just the problem about creating this folder.

BrowneR wrote:
> I can confirm what ward says in Jaunty.
>
> "creating ~/PDF is *not* sufficient to solve this"
>
> AppArmor is still preventing printing therefore the title of this bug
> report is misleading.
>

Revision history for this message
Micah Gersten (micahg) wrote :

Seems like a dup of bug 224365. Fix was released in 1.3.10-4. Karmic has the fix.

Revision history for this message
David Stansby (dstansby-deactivatedaccount) wrote :

Yep, fix has been released in karmic.

Changed in cups-pdf (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
David Stansby (dstansby-deactivatedaccount) wrote :

I think the hundredpapercuts task is invalid because cups-pdf doesn't come on a vanilla install of ubuntu.

Changed in hundredpapercuts:
status: New → Fix Released
status: Fix Released → Invalid
Changed in apparmor (Ubuntu):
status: New → Fix Released
Revision history for this message
Alroger Filho (alroger-filho) wrote :

I still have this problema in Lucid. Same thing that happened when I installed Karmic.
PDF folder is already in users home dir, everything seems fine, but nothing comes out when printing PDFs.

root@phenom:/var/log/cups# tail -f cups-pdf_log
Tue May 4 17:55:06 2010 [ERROR] failed to open source stream

As soon as I stop apparmor and restart cups and samba everything starts working like it should.
I tried starting apparmor again and my system hang with LOADs of disk access, had to rebootit.

After reboot, apparmor came up again with the same problem. So I just uninstalled apparmor.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Alroger, please do not disable all of AppArmor-- there are a lot of profiles protecting your system that are unrelated to cups-pdf. Please see https://wiki.ubuntu.com/DebuggingApparmor for details on how to temporarily or permanently disable the problematic profile, as well as how to debug it. If it is found this is a problem with the profile, please file a different bug.

Revision history for this message
Ivan Diaz (saisyukusanagi) wrote :

SOLVED by the easiest way (Disabling cups apparmor profile)

Run these commands ...

mkdir $HOME/PDF
mkdir $HOME/PDF
sudo mv /etc/apparmor.d/usr.sbin.cupsd /etc/apparmor.d/disable/.
sudo /etc/init.d/apparmor restart

Revision history for this message
Ivan Diaz (saisyukusanagi) wrote :

#26 : Ubuntu must be the easy way for a linux new user ... The normal user don't have idea that apparmor exists ... and you know it ... why they have to debug it ... The ubuntu packagers must test their software as the debian way and solve it during the alpha beta gamma testing ...

Revision history for this message
papukaija (papukaija) wrote :

@saisyukusanagi: Your last comment shows that:
- you aren't using the latest Ubuntu. Upgrade it now.
- you haven't noticed that this bug is actually fixed.
- you haven't noticed that cups-pdf isn't installed by default and that this package comes from the universe repository so it doesn't need to be tested so much.

Ps. This comment isn't meant to be rude, but your comment just shows a lack of knowledge.

Revision history for this message
ward (ward-pong) wrote :

@papukaija: this bug is *not* fixed. It's been a problem since intrepid, and it's still a problem in Lucid. Please read the entire thread.

I'm running Lucid, fully up to date, and cups-pdf print jobs just disappear if apparmor is running.

Revision history for this message
Ivan Diaz (saisyukusanagi) wrote :
Download full text (4.5 KiB)

@papukaija:
"- you aren't using the latest Ubuntu. Upgrade it now."

FIRST: I'm using the latest Ubuntu version:

~$ cat /etc/debian_version
squeeze/sid

~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04 LTS
Release: 10.04
Codename: lucid

"- you haven't noticed that this bug is actually fixed."

SECOND: I have the latest CUPS packages.

ii cups-bsd 1.4.3-1ubuntu1.2 Common UNIX Printing System(tm) - BSD comman
ii cups-client 1.4.3-1ubuntu1.2 Common UNIX Printing System(tm) - client pro
ii cups-common 1.4.3-1ubuntu1.2 Common UNIX Printing System(tm) - common fil
ii cups-driver-gutenprint 5.2.5-0ubuntu1 printer drivers for CUPS
ii cups-pdf 2.5.0-12 PDF printer for CUPS

.... And is not fixed yet !!!!

~$ tail /var/log/cups/cups-pdf_log
Mon Jun 28 12:24:51 2010 [ERROR] failed to create directory (/home/user/PDF)
Mon Jun 28 12:24:51 2010 [ERROR] failed to create user output directory (/home/user/PDF)
Mon Jun 28 12:28:19 2010 [ERROR] failed to create directory (/home/user/PDF)
Mon Jun 28 12:28:19 2010 [ERROR] failed to create user output directory (/home/user/PDF)
Mon Jun 28 12:29:35 2010 [ERROR] failed to set file mode for PDF file (non fatal) (/home/user/PDF/_ubuntu___SOLVED__pdf-cups_failed_-_Ubuntu_Forums.pdf)
Mon Jun 28 12:31:16 2010 [ERROR] failed to set file mode for PDF file (non fatal) (/home/user/PDF/_ubuntu___SOLVED__pdf-cups_failed_-_Ubuntu_Forums.pdf)
Mon Jun 28 12:40:57 2010 [ERROR] failed to set file mode for PDF file (non fatal) (/home/user/PDF/about_blank.pdf)

~$ tail /var/log/messages
Jun 28 12:28:19 mymachine kernel: [323246.032824] type=1503 audit(1277746099.230:44): operation="mkdir" pid=29283 parent=29073 profile="/usr/lib/cups/backend/cups-pdf" requested_mask="c::" denied_mask="c::" fsuid=0 ouid=0 name="/home/user/PDF/"
Jun 28 12:29:35 mymachine kernel: [323322.700690] type=1503 audit(1277746175.899:45): operation="open" pid=29367 parent=29366 profile="/usr/lib/cups/backend/cups-pdf" requested_mask="::r" denied_mask="::r" fsuid=10000 ouid=0 name="/proc/filesystems"
Jun 28 12:29:35 mymachine kernel: [323322.701763] type=1503 audit(1277746175.899:46): operation="open" pid=29367 parent=29366 profile="/usr/lib/cups/backend/cups-pdf" requested_mask="::r" denied_mask="::r" fsuid=10000 ouid=0 name="/proc/filesystems"
Jun 28 12:29:35 mymachine kernel: [323322.701844] type=1503 audit(1277746175.899:47): operation="mknod" pid=29367 parent=29366 profile="/usr/lib/cups/backend/cups-pdf" requested_mask="c::" denied_mask="c::" fsuid=10000 ouid=10000 name="/home/user/PDF/_ubuntu___SOLVED__pdf-cups_failed_-_Ubuntu_Forums.pdf"
Jun 28 12:31:16 mymachine kernel: [323423.301164] type=1503 audit(1277746276.499:48): operation="open" pid=29482 parent=29481 profile="/usr/lib/cups/backend/cups-pdf" requested_mask="::r" denied_mask="::r" fsuid=10000 ouid=0 name="/proc/filesystems"
Jun 28 12:31:16 m...

Read more...

Revision history for this message
papukaija (papukaija) wrote :

@saisyukusanagi: Then you are experiencing a different bug. Please open a new bug (with ubuntu-bug cups-pdf) after searching foe exinsting ones.

Revision history for this message
Ivan Diaz (saisyukusanagi) wrote :

@papukaija: Is the same freakin bug ... Don't you see?

[ERROR] failed to create user output directory
[ERROR] failed to create directory

Where is the PDF folder ... It doesn't work even if you do the mkdir ... And disable the apparmor cups context (in my case) is not the final solution.

Off course ... I will open a new bug and begin the same redundant discussion ... yes ... after to install Debian Arch or another distro where the packager understand how much frustrating is to deal with things like these ...

Please forgive my terms ... i'm upset but no with you, my idea is not to do a flamewar ... (like Mark Shuttlework said: Ubuntu is not a democracy) I only want that any user expert or newbie want when there is a problem ... the simple solution. I'm not the only user with the problem. And it seems like we aren't listened

Revision history for this message
papukaija (papukaija) wrote :

@ward and @saisyukusanagi: This bug is fixed since Karmic. You can try to manually create a folder called "PDF" to your home directory. Plase note that cups-pdf need write access to your your home directory, for example a permission of 700 to your home folder would probably make cups-pdf fail to create the PDF directory. Start by resetting your home folder's permissions or run the following command from the terminal which changes the permissions to 701 (proven to work at https://bugs.launchpad.net/ubuntu/+source/cups/+bug/224365/comments/18) :

chmod 701 $HOME

If that doesn't help, then create manually the PDF folder using this command:

rm -fr ~/PDF && mkdir -m 701 -p ~/PDF
(it will first delete the existing pdf folder and then create a new one with 701 permissions)

If cups-pdf is still not working, then create a new user account and try to use cups-pdf. If that also fails, then please open a new bug (with ubuntu-bug cups-pdf) after searching for existing ones.

Btw, this bug is a dupplicate of the above mentioned bus as stated in comment 22 (ward, I have read the all comments of this bug report).

Norbert (nrbrtx)
tags: added: precise
Norbert (nrbrtx)
tags: removed: precise
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.