Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] GTK+ Applications Won't Print - CUPS Issue?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
stunirvana21
n00b
n00b


Joined: 24 May 2011
Posts: 41

PostPosted: Tue Apr 03, 2012 2:43 pm    Post subject: [Solved] GTK+ Applications Won't Print - CUPS Issue? Reply with quote

GTK+ applications aren't able to print and give the following error when selecting any of the printers:

Code:

Getting printer information failed


I can however print from the command line using lpr. I have the system setup to print to an external CUPS server.


After skimming many bug pages and other resources, I think it has something to do with the fact that the CUPS server requires encryption and this somehow throws off GTK+. I think GTK+ somehow uses lpoptions -l which for some reason doesn't work. Here is an example:

Code:

# lpoptions
auth-info-required=none copies=1 device-uri=socket://xxx.xxx.xxx.xxx finishings=3 job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=1333382143 marker-colors=none marker-levels=78 marker-names='Toner Cartridge HP C8061X' marker-types=toner number-up=1 printer-commands=AutoConfigure,Clean,PrintSelfTestPage printer-info='HP LaserJet 4100' printer-is-accepting-jobs=true printer-is-shared=true printer-location='X' printer-make-and-model='HP LaserJet 4100 Series v.3010.107 Postscript (recommended)' printer-state=3 printer-state-change-time=1333382143 printer-state-reasons=none printer-type=8425668 printer-uri-supported=ipp://xx.xx:443/printers/c012lpr
# lpoptions -l
lpoptions: Unable to get PPD file for c012lpr: Bad Request
# lpoptions -El
auth-info-required=none copies=1 device-uri=socket://xxx.xxx.xxx.xxx finishings=3 job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=1333382143 marker-colors=none marker-levels=78 marker-names='Toner Cartridge HP C8061X' marker-types=toner number-up=1 printer-commands=AutoConfigure,Clean,PrintSelfTestPage printer-info='HP LaserJet 4100' printer-is-accepting-jobs=true printer-is-shared=true printer-location='X' printer-make-and-model='HP LaserJet 4100 Series v.3010.107 Postscript (recommended)' printer-state=3 printer-state-change-time=1333382143 printer-state-reasons=none printer-type=8425668 printer-uri-supported=ipp://xx.xx:443/printers/c012lpr
#


So if I force encryption using the -E flag for lpoptions, it seems to work.

To me it seems that I can't print GTK+ applications since somehow encryption messes up the process. So maybe it is a CUPS issue either local or on the server?

Here is the clients.conf file on the local machine:

Code:

# cat /etc/cups/client.conf
#ServerName /var/run/cups/cups.sock
Encryption Required
ServerName xxx.xxx.xxx.xxx:443


Here is the cupsd.conf file on the server:

Code:

# cat cupsd.conf 
#
# "$Id: cupsd.conf.in 9310 2010-09-21 22:34:57Z mike $"
#
# Sample configuration file for the CUPS scheduler.  See "man cupsd.conf" for a
# complete description of this file.
#

# Log general information in error_log - change "warn" to "debug"
# for troubleshooting...
LogLevel warn

# Administrator user group...
SystemGroup lpadmin
ServerAdmin admins@xx.xx
PageLog /var/log/cups/page_log

SSLPort 443
Port 631
Listen *:631
Listen /var/run/cups/cups.sock


# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseLocalProtocols CUPS

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Restrict access to the server...
<Location />
  Order allow,deny
  Allow from xxx.xxx.xx2.*
  Allow from xxx.xxx.xx3.*
  Allow from xxx.xxx.xx4.*
  Allow from xxx.xxx.xx5.*
  Allow from xxx.xxx.xx6.*
  Allow from localhost
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Allow from xxx.xxx.xxx.xxx
  Order allow,deny
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
</Location>

# Set the default printer/job policies...
<Policy default>
  # Job-related operations must be done by the owner or an administrator...
  <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 CUPS-Move-Job CUPS-Get-Document>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  # All administration operations require an administrator to authenticate...
  <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>

  # All printer operations require a printer operator to authenticate...
  <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 CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

# Set the authenticated printer/job policies...
<Policy authenticated>
  # Job-related operations must be done by the owner or an administrator...
  <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 CUPS-Move-Job CUPS-Get-Document>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  # All administration operations require an administrator to authenticate...
  <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>

  # All printer operations require a printer operator to authenticate...
  <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 CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

#
# End of "$Id: cupsd.conf.in 9310 2010-09-21 22:34:57Z mike $".
#


Sorry if this post is in the wrong forum.

Any ideas?


Last edited by stunirvana21 on Thu Apr 05, 2012 4:33 am; edited 1 time in total
Back to top
View user's profile Send private message
stunirvana21
n00b
n00b


Joined: 24 May 2011
Posts: 41

PostPosted: Thu Apr 05, 2012 4:33 am    Post subject: Reply with quote

I can't believe it, but it all boiled down to a name resolution issue on the CUPS server.

The server's hostname was specified in /etc/hosts, but not the hostname.domain name even though /etc/resolv.conf contained the domain information. So for some reason the CUPS server needed that line in /etc/hosts in order for clients to query using lpoptions -l.

Crazy...
Back to top
View user's profile Send private message
urcindalo
l33t
l33t


Joined: 08 Feb 2005
Posts: 623
Location: Almeria, Spain

PostPosted: Tue Jul 03, 2012 2:58 pm    Post subject: Reply with quote

Could you tell me what did you do, exactly? I mean, the whole line you modified/included in order to get cups working.
In my case, my /etc/hosts ys pretty simple:
Code:
127.0.0.1       localhost       Ptero   localhost.localdomain
::1             localhost       Ptero   localhost.localdomain


I just want to be able to print from my localhost to a USB attached printer. It's becoming an increasingly difficult task to achieve :?
Back to top
View user's profile Send private message
ishmael4
n00b
n00b


Joined: 17 Aug 2008
Posts: 5

PostPosted: Sun Aug 05, 2012 2:49 pm    Post subject: Reply with quote

Adding entry for CUPS server to /etc/hosts resolved issue for me too. And in client.conf I refer to the server via it's IP address so that indeed seems irrational.

urcindalo, check your client.conf configuration and add according entries for servers to /etc/hosts

E.g. client.conf:

Code:

# cat /etc/cups/client.conf
ServerName 192.168.0.2:631


has corresponding entry in /etc/hosts:

Code:

192.168.0.2 <my_name> <my_name>.<my_domain>


It looks like a result of lpoptions's officious revdns queries.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum