CUPS problem: "Unable to open print file: Permission denied" and "client-error-not-found"

Hello,

I’m having problems with a network printer installed in my work. It’s a HP LJ M5035 and I installed it using hplip.

The printer is well installed because I can see all its properties (remaining ink, paper, status, etc). But, If I try to print any file I get a “Unable to open print file: Permission denied” message in the cups page (http://localhost:631/jobs/). Also I’m getting an almost constant client-error-not-found message in the /var/log/cups/error_log file.

I read somewhere that this could be a wrong set of permissions on the backends, but until now, I don’t know how to fix it.

Does anyone have some suggestion?

Thanks for your answer.

Best regards.

***Some relevant information: ***

The /var/log/cups/error_log when I try to print something -> [Bash] E [01/Jul/2013:14:49:03 +0200] [cups-polld 130.120.226.13:631] CUPS-Get-Printers - Pastebin.com](http://pastebin.com/3E38d9Li)

hp-check -> [Bash] # hp-check HP Linux Imaging and Printing System (ver. 3.12.11) Dependency/Ve - Pastebin.com](http://pastebin.com/kfjTpscq)


**ls -l /usr/lib/cups/backend/**
total 340
-rwxrwxr-x+ 1 root root   7250 Jan 28 07:31 beh
-r-xr-xr-x+ 1 root root  19064 Jan 28 12:09 hp
-rw-rw-r--+ 1 root users 10679 Jul  1 12:35 hp-check.log
-rw-------+ 1 root root   8989 Jan 28 12:08 hpfax
lrwxrwxrwx  1 root root      3 Jul  1 12:07 http -> ipp
lrwxrwxrwx  1 root root      3 Jul  1 12:07 https -> ipp
-rwx------+ 1 root root  69008 Feb  7 10:06 ipp
lrwxrwxrwx  1 root root      3 Jul  1 12:07 ipps -> ipp
-rwx------+ 1 root root  44024 Feb  7 10:06 lpd
-r-xr-xr-x+ 1 root root  35736 Feb  7 10:06 parallel
-rwxr-xr-x+ 1 root root   3135 Jan 26 16:22 pipe
-r-xr-xr-x+ 1 root root  35720 Feb  7 10:06 serial
lrwxrwxrwx  1 root users    17 Jun 19 15:37 smb -> /usr/bin/smbspool
-r-xr-xr-x+ 1 root root  27464 Feb  7 10:06 snmp
-r-xr-xr-x+ 1 root root  35712 Feb  7 10:06 socket
-r-xr-xr-x+ 1 root root  35720 Feb  7 10:06 usb


**ls -l /usr/lib/cups/filter/
**total 1088
-r-xr-xr-x+ 1 root root  39800 Feb  7 10:06 bannertops
-rwxr-xr-x+ 1 root root  10560 Jan 28 07:59 commandtocanon
-rwxr-xr-x+ 1 root root  10576 Jan 28 07:59 commandtoepson
-r-xr-xr-x+ 1 root root  10624 Feb  7 10:06 commandtoescpx
-r-xr-xr-x+ 1 root root  10592 Feb  7 10:06 commandtopclx
-r-xr-xr-x+ 1 root root  14816 Feb  7 10:06 commandtops
lrwxrwxrwx  1 root root     25 Mar  6 12:26 foomatic-rip -> ../../../bin/foomatic-rip
lrwxrwxrwx  1 root root     25 Jul  1 11:59 foomatic-rip-hplip -> ../../../bin/foomatic-rip
-rwxrwxr-x+ 1 root root   6975 Jan 27 14:06 gstopxl
-rwxrwxr-x+ 1 root root  27400 Jan 27 14:07 gstoraster
-r-xr-xr-x+ 1 root root  10600 Feb  7 10:06 gziptoany
-rwxr-xr-x+ 1 root root  14354 Jan 28 12:08 hpcac
-rwxr-xr-x+ 1 root root 384104 Jan 28 12:09 hpcups
-rwxr-xr-x+ 1 root root  27184 Jan 28 12:09 hpcupsfax
-rwxr-xr-x+ 1 root root  10600 Jan 28 12:09 hplipjs
-rwxr-xr-x+ 1 root root   7688 Jan 28 12:08 hpps
-r-xr-xr-x+ 1 root root  31432 Feb  7 10:06 imagetops
-r-xr-xr-x+ 1 root root  57440 Feb  7 10:06 imagetoraster
-r-xr-xr-x+ 1 root root  23152 Feb  7 10:06 pdftops
-r-xr-xr-x+ 1 root root  52024 Feb  7 10:06 pstops
-rwxr-xr-x+ 1 root root  19136 Jan 27 03:43 pstoqpdl
-rwxr-xr-x+ 1 root root    962 Jan 28 12:08 pstotiff
lrwxrwxrwx  1 root root     13 Jul  1 12:07 rastertodymo -> rastertolabel
-r-xr-xr-x+ 1 root root  18944 Feb  7 10:06 rastertoepson
-r-xr-xr-x+ 1 root root  35520 Feb  7 10:06 rastertoescpx
-rwxr-xr-x+ 1 root root  44256 Jan 28 07:59 rastertogutenprint.5.2
-r-xr-xr-x+ 1 root root  18912 Feb  7 10:06 rastertohp
-r-xr-xr-x+ 1 root root  23072 Feb  7 10:06 rastertolabel
-r-xr-xr-x+ 1 root root  35528 Feb  7 10:06 rastertopclx
-r-xr-xr-x+ 1 root root  14816 Feb  7 10:06 rastertopwg
-rwxr-xr-x+ 1 root root  52032 Jan 27 03:43 rastertoqpdl
-r-xr-xr-x+ 1 root root  55200 Feb  7 10:06 texttops

Your cups is trying to connect to 130.120.226.13 and fails. Are you sure that’s the correct address of your printer?

FYI: That is a public IP address (although not reachable by me); if the printer is in your LAN it should have some private address like 10.x.y.z, 172.l.m.n or 192.168.a.b I guess…

And what is the openSUSE version you use?

Yes, I am. In fact, I can see all the properties of the printer in my machine (Startseite - imagebin.org)

I’m in 12.3.

Regards.

On 2013-07-01 16:26, mikesol wrote:
>
> wolfi323;2568695 Wrote:
>> Are you sure that’s the correct address of your printer?
>
> Yes, I am.

Well, as it is a Internet address, you have to verify the path taken by
the packages, looking at routers and firewalls. It does not work from here.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Maybe there is some institutional firewall or something like that.

How could I provide you more information?

You could at least tell if it is true that the printer is at your work (as you told), but your system is not. When that is true (your system being at your home for example), then it is rather logical that your work has some firewall in place that prevents systems from outside do roam around on your work’s network. And that will of course include printing from everybody on the world to your work’s printer. Isn’t that very logical?

When you want to print over the internet to a printer in your work’s network, you must contact the network manager there. Maybe he will allow your system.

Sorry my bad. I’m in my work place and the printer is connected via ethernet. I will try to talk with the administrator, but for me there is some misconfiguration somewhere in my machine that doesn’t allow print.

When I installed 12.3 for the first time I could print without any problem.

Best regards.

mikesol wrote:
> Sorry my bad. I’m in my work place and the printer is connected via
> ethernet. I will try to talk with the administrator, but for me there is
> some misconfiguration somewhere in my machine that doesn’t allow print.
>
> When I installed 12.3 for the first time I could print without any
> problem.

It seems quite likely there is some misconfiguration on your machine,
but it could also be a problem in the network.

I don’t know enough about CUPS to diagnose accurately using it. So I
would ask whether you have tried to use YaST to diagnose it?

Or from the command line, use telnet to try to connect to the
appropriate port and see what error occurs.

On 2013-07-01 18:21, Dave Howorth wrote:
> mikesol wrote:
>> Sorry my bad. I’m in my work place and the printer is connected via
>> ethernet. I will try to talk with the administrator, but for me there is
>> some misconfiguration somewhere in my machine that doesn’t allow print.
>>
>> When I installed 12.3 for the first time I could print without any
>> problem.
>
> It seems quite likely there is some misconfiguration on your machine,
> but it could also be a problem in the network.

It is an HP printer connected on a real Internet address, so, assuming
the network guys there know their job, it will be heavily protected
behind a good firewall. And very probably they change things from time
to time.

I would perhaps try a traceroute on the port used by the printer (9100?).


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

If I understood correctly, you wanted that I did something like this:

# traceroute 130.120.226.13
traceroute to 130.120.226.13 (130.120.226.13), 30 hops max, 40 byte packets using UDP
 1  perec.ups-tlse.fr (130.120.226.13)  1.105 ms   1.147 ms   1.516 ms

On the other side, I tried to print a test page using Yast and I got this message:

http://thumbnails102.imagebam.com/26340/797444263397472.jpg](http://www.imagebam.com/image/797444263397472)

Seeing your logging with the error above, I tend to see it as a local problem instead of network problem. Maybe we were a bit walking the wrong p[ath because of the unusula public IP address of the printer (which btw need [b]not te be reachable on the Internet; when you are “owner” of a public IP address range, you can use that on an internal network when you think fit).

Normaly with a permission poblem, we ask for an ls -l of the file and check who is the owner of the process that tries to acccess the file.

Maybe we can try a print from the command line:

lp -d <destination> <file>

Where <destination> should be replaced by the printer name and <file> can be a simple text file with a few ASCII lines.

On 2013-07-02 11:36, mikesol wrote:
>
> robin_listas;2568807 Wrote:
>>
>> I would perhaps try a traceroute on the port used by the printer
>> (9100?).
>>
>
> If I understood correctly, you wanted that I did something like this:
>

“On the port used by the printer” - ie, using “-p” - (see the man).

> On the other side, I tried to print a test page using Yast and I got
> this message:
>
> ‘[image: http://thumbnails102.imagebam.com/26340/797444263397472.jpg]’
> (http://www.imagebam.com/image/797444263397472)

well, that’s a different error. The rest would be in the error_log file.
If not enough, increase verbosity, to find out which file has the
permission denied.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

On 2013-07-02 12:06, hcvv wrote:
>
> Seeing your logging with the error above, I tend to see it as a local
> problem instead of network problem. Maybe we were a bit walking the
> wrong path because of the unusula public IP address of the printer
> (which btw need not te be reachable on the Internet; when you are
> “owner” of a public IP address range, you can use that on an internal
> network when you think fit).

Provided you have routing tables that handle those packets internally :wink:

> Normaly with a permission poblem, we ask for an ls -l of the file and
> check who is the owner of the process that tries to acccess the file.

I saw a thread yesterday with a similar permission denied message. But I
can’t remember which thread :frowning:


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

The traceroute thing gives the same output:

traceroute -p 9100  130.120.226.13 
traceroute to 130.120.226.13 (130.120.226.13), 30 hops max, 40 byte packets using UDP
 1  perec.ups-tlse.fr (130.120.226.13)  1.086 ms   1.140 ms   1.734 ms

This is my configuration in /etc/cups/cupsd.conf (with LogLevel debug )

cat /etc/cups/cupsd.conf
LogLevel debug
SystemGroup sys root lp
# Allow remote access
#Port 631
Listen *:631
Listen localhost:631
Listen /var/run/cups/cups.sock
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseLocalProtocols CUPS
BrowseAddress @LOCAL
DefaultAuthType Basic
WebInterface Yes
<Location />
Allow @IF(eth0)
Allow @LOCAL
Allow all
Order allow,deny
Allow 127.0.0.2
</Location>
<Location /admin>
</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
</Location>
<Policy default>
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    Order deny,allow
  </Limit>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
<Policy authenticated>
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    AuthType Default
    Order deny,allow
  </Limit>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
<Policy allowallforanybody>
  <Limit All>
    Order deny,allow
    Allow from all
  </Limit>
</Policy>
DefaultPolicy default
FileDevice yes
# 2013-07-02,10:43:07 modify_cupsd_conf Listen localhost
# 2013-07-02,10:43:48 modify_cupsd_conf Allow @IF(eth0) @LOCAL all
# 2013-07-02,10:43:48 modify_cupsd_conf BrowseAddress @LOCAL
# 2013-07-02,10:43:49 modify_cupsd_conf Browsing On
# 2013-07-02,10:43:49 modify_cupsd_conf Listen all

I launched something to print and I got this output in the /var/log/cups/error_log

Maybe this helps? From 12.5 CUPS :: Chapter 12: Printing :: How linux works :: Linux systems :: eTutorials.org

Spool Directory Permission ErrorsLook for this message in your error log:
E [timestamp] [Job n] unable to open print file - : Permission denied

CUPS normally runs its filters as the pseudo-user lp and the group sys, so this user must have access to the spool directory /var/spool/cups in order to access intermediate data. When fixing the permissions, look for these problems:

  • Check all component directories of /var/spool/cups. Can the lp user access each of them?

  • Make sure that you have the lp user in your /etc/passwd file.

  • Verify that lp belongs to the sys group. (Remember that you can change the pseudo-user and group with the User and Group parameters of cupsd.conf.)

On my system:

wolfi@amiga:~> sudo ls -la /var/spool/cups/
insgesamt 52
drwx--x---  3 root lp   384 26. Jun 08:35 .
drwxr-xr-x 14 root root 368 12. Mär 00:14 ..
-rw-------  1 root lp   820 18. Jän 16:30 c00810
-rw-------  1 root lp   662 19. Mär 18:15 c00811
-rw-------  1 root lp   740 10. Jun 10:18 c00812
-rw-------  1 root lp   697 10. Jun 10:19 c00813
-rw-------  1 root lp   740 10. Jun 10:20 c00814
-rw-------  1 root lp   742 10. Jun 10:39 c00815
-rw-------  1 root lp   620 10. Jun 10:39 c00816
-rw-------  1 root lp   740 10. Jun 10:40 c00817
-rw-------  1 root lp   740 10. Jun 10:40 c00818
-rw-------  1 root lp   740 10. Jun 10:42 c00819
-rw-------  1 root lp   707 10. Jun 10:44 c00820
-rw-------  1 root lp   697 10. Jun 10:45 c00821
-rw-------  1 root lp   862 26. Jun 08:35 c00822
drwxrwx--T  2 root lp    48 27. Jun 10:53 tmp
wolfi@amiga:~> grep lp /etc/passwd /etc/group
/etc/passwd:lp:x:4:7:Printing daemon:/var/spool/lpd:/bin/bash
/etc/passwd:openslp:x:118:2:openslp daemon:/var/lib/empty:/sbin/nologin
/etc/group:lp:*:7:
wolfi@amiga:~>

Thanks wolfi323 for the explanation. Maybe this is the problem. I have this:

 # ls -la /var/spool/cups/
total 40
drwx--x---+  3 root nobody 4096 Jul  2 12:43 .
drwxrwxr-x+ 13 root root   4096 Jun 20 08:15 ..
-rw-------+  1 root nobody  834 Jul  2 11:44 c00091
-rw-------+  1 root nobody  854 Jul  2 12:20 c00092
-rw-------+  1 root nobody  748 Jul  2 12:27 c00093
-rw-------+  1 root nobody  854 Jul  2 12:43 c00094
-rw-r-----+  1 root nobody   55 Jul  2 12:20 d00092-001
-rw-r-----+  1 root nobody   32 Jul  2 12:27 d00093-001
-rw-r-----+  1 root nobody   55 Jul  2 12:43 d00094-001
drwxrwx--T+  2 root nobody 4096 Jul  2 15:44 tmp

 # grep lp /etc/passwd /etc/group
/etc/passwd:lp:x:4:7:Printing daemon:/var/spool/lpd:/bin/bash
/etc/group:lp:x:7:mikesol,root

I guess that I have to make something like

**chown -R lp /var/spool/cups/**

Am I right?

Yes, according to your listing the cups filters can’t access the spool directory if they are not running as root.

I guess that I have to make something like

**chown -R lp /var/spool/cups/**

Am I right?

I guess that would work (if they get run as user lp), but normally the directory and the files are owned by root:lp (you would change them to lp:nobody).
So I think you better should do:

chgrp -R lp /var/spool/cups/

If that doesn’t work, you can still try your chown line as well.

On 2013-07-02 16:06, mikesol wrote:
>
> wolfi323;2568920 Wrote:
>> Maybe this helps? From ‘12.5 CUPS :: Chapter 12: Printing :: How linux
>> works :: Linux systems :: eTutorials.org’ (http://tinyurl.com/ck6xjto)
>>
>
> Thanks wolfi323 for the explanation. Maybe this is the problem. I have
> this:
>



>      # ls -la /var/spool/cups/
>   total 40
>   drwx--x---+  3 root nobody 4096 Jul  2 12:43 .
>   drwxrwxr-x+ 13 root root   4096 Jun 20 08:15 ..

I have:

Telcontar:~ # ls -la /var/spool/cups/
total 1300
drwx--x---  3 root lp   12288 Jul  1 23:01 .
drwxr-xr-x 18 root root  4096 Jun 10 01:21 ..
-rw-------  1 root lp     905 Sep 24  2010 c01985
-rw-------  1 root lp     939 Sep 24  2010 c01986




>   # grep lp /etc/passwd /etc/group
>   /etc/passwd:lp:x:4:7:Printing daemon:/var/spool/lpd:/bin/bash
>   /etc/group:lp:x:7:mikesol,root

I have:

/etc/passwd:lp:x:4:7:Printing daemon:/var/spool/lpd:/bin/bash
/etc/group:lp:*:7:


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Thanks to both. I made the changes and tomorrow I’ll try to print something in my workplace. Of course, I’ll report back if something happens.