PDA

View Full Version : [ubuntu] Unable to add printer using CUPS


SumnerBoy
May 5th, 2008, 07:07 AM
Hi - I am doing a fresh reinstall of my home server using 8.04 (from 7.10). I have come to the printer configuration and have hit a brick wall.

I have CUPS up and running and can access from the network on port 631. CUPS recognises I have a USB printer but when I try to add the printer and click the final 'Add Printer' button I get a 404 page and the following in the log (debug enabled)...

D [05/May/2008:23:01:51 +1200] cupsdReadClient: 8 POST /admin HTTP/1.1
D [05/May/2008:23:01:51 +1200] cupsdAuthorize: No authentication data provided.
D [05/May/2008:23:01:51 +1200] [CGI] /usr/lib/cups/cgi-bin/admin.cgi started - PID = 6186
I [05/May/2008:23:01:51 +1200] Started "/usr/lib/cups/cgi-bin/admin.cgi" (pid=6186)
D [05/May/2008:23:01:51 +1200] cupsdSendCommand: 8 file=11
D [05/May/2008:23:01:51 +1200] [CGI] admin.cgi started...
D [05/May/2008:23:01:51 +1200] [CGI] http=0x8079ff8
D [05/May/2008:23:01:51 +1200] [CGI] op="add-printer"...
D [05/May/2008:23:01:51 +1200] [CGI] do_am_printer: DEVICE_URI="canon:/dev/usb/lp0"
D [05/May/2008:23:01:51 +1200] cupsdAcceptClient: 9 from localhost (Domain)
D [05/May/2008:23:01:51 +1200] cupsdReadClient: 9 POST /admin/ HTTP/1.1
D [05/May/2008:23:01:51 +1200] cupsdAuthorize: No authentication data provided.
D [05/May/2008:23:01:51 +1200] CUPS-Add-Modify-Printer ipp://localhost/printers/MP530
D [05/May/2008:23:01:51 +1200] cupsdIsAuthorized: username=""
E [05/May/2008:23:01:51 +1200] CUPS-Add-Modify-Printer: Unauthorized
D [05/May/2008:23:01:51 +1200] cupsdSendError: 9 code=401 (Unauthorized)
D [05/May/2008:23:01:51 +1200] cupsdSendHeader: WWW-Authenticate: Basic realm="CUPS"
D [05/May/2008:23:01:51 +1200] cupsdCloseClient: 9
D [05/May/2008:23:01:51 +1200] [CGI] cgi_passwd(prompt="Password for lp on localhost? ") called!
D [05/May/2008:23:01:51 +1200] PID 6186 (/usr/lib/cups/cgi-bin/admin.cgi) exited with no errors.
D [05/May/2008:23:01:51 +1200] cupsdSendError: 8 code=401 (Unauthorized)
D [05/May/2008:23:01:51 +1200] cupsdSendHeader: WWW-Authenticate: Basic realm="CUPS"
D [05/May/2008:23:01:51 +1200] cupsdCloseClient: 8
I [05/May/2008:23:01:51 +1200] cupsdCloseClient: SSL shutdown successful!
D [05/May/2008:23:01:51 +1200] cupsdCloseClient: 8
D [05/May/2008:23:01:51 +1200] cupsdAcceptClient: 8 from 192.168.1.4:631 (IPv4)
D [05/May/2008:23:01:51 +1200] encrypt_client: 8 Connection from 192.168.1.4 now encrypted.
D [05/May/2008:23:01:51 +1200] cupsdReadClient: 8 POST /admin HTTP/1.1


Here is my /etc/cups/cupsd.conf

#
#
# Sample configuration file for the Common UNIX Printing System (CUPS)
# scheduler. See "man cupsd.conf" for a complete description of this
# file.
#

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

# Administrator user group...
SystemGroup lpadmin


# Only listen for connections from the local machine.
Listen localhost:631
Listen 192.168.1.21:631
Listen /var/run/cups/cups.sock

# Show shared printers on the local network.
Browsing Off
BrowseOrder allow,deny
BrowseAllow all
BrowseAddress @LOCAL

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

# Restrict access to the server...
<Location />
Order allow,deny
Allow From All
</Location>

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

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

<Location /printers>
AuthType None
Order Deny,Allow
Deny From None
Allow From All
</Location>

# Set the default printer/job policies...
<Policy default>
# Job-related operations must be done by the owner or an administrator...
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set$
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$
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-Prin$
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>

#
#


Thanks in advance for any pointers!

Gooorn
May 6th, 2008, 04:16 AM
Exactly the same thing is giving me an headache.

Anyone can help?

Thanx,

Sinisa Perovic

SumnerBoy
May 8th, 2008, 06:45 AM
Can anyone help with this? Seems quite a few people are having the same problems.

nquinnathome1
May 9th, 2008, 03:12 AM
In cupsd.conf, add somewhere near the top (i.e. before <Location />)

DefaultEncryption Never

Should then allow you to access CUPS over a standard HTTP connection without requiring HTTPS

Failing that, I had a similar problem only it appears to be a bug where CUPS stops running when you try and authenticate, and I solved the problem here: http://ubuntuforums.org/showthread.php?p=4916761#post4916761