2015-03-20

New Cups Troubleshooting page (moved from main article)

New page

[[Category:Printers]]

See [[CUPS]] for the main article.

== Troubleshooting ==

The best way to get printing working is to set 'LogLevel' in {{ic|/etc/cups/cupsd.conf}} to:

LogLevel debug

And then viewing the output from {{ic|/var/log/cups/error_log}} like this:

# tail -n 100 -f /var/log/cups/error_log

The characters at the left of the output stand for:

*D=Debug

*E=Error

*I=Information

*And so on

These files may also prove useful:

*{{ic|/var/log/cups/page_log}} - Echoes a new entry each time a print is successful

*{{ic|/var/log/cups/access_log}} - Lists all cupsd http1.1 server activity

Of course, it is important to know how CUPS works if wanting to solve related issues:

# An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when 'print' has been selected (this is the case with most programs).

# CUPS then looks at the printer's PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL, PCL), usually GhostScript.

# GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.

# Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.

Print a document and watch {{ic|error_log}} to get a more detailed and correct image of the printing process.

=== Problems resulting from upgrades ===

''Issues that appeared after CUPS and related program packages underwent a version increment''

==== CUPS stops working ====

The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" may result from trying to manage CUPS via localhost:631, for example.

To use the new configuration, copy {{ic|/etc/cups/cupsd.conf.default}} to {{ic|/etc/cups/cupsd.conf}} (backup the old configuration if needed) and restart CUPS to employ the new settings.

==== All jobs are "stopped" ====

If all jobs sent to the printer become "stopped", delete the printer and add it again.

Using the [http://localhost:631 CUPS web interface], go to Printers > Delete Printer.

To check the printer's settings go to ''Printers'', then ''Modify Printer''. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), and so on.

==== All jobs are "The printer is not responding" ====

On networked printers, you should check that the name that CUPS uses as its connection URI resolves to the printer's IP via DNS, e.g.

If your printer's connection looks like this:

lpd://BRN_020554/BINARY_P1

then the hostname 'BRN_020554' needs to resolve to the printer's IP from the server running CUPS

==== The PPD version is not compatible with gutenprint ====

Run:

# /usr/bin/cups-genppdupdate

And restart CUPS (as pointed out in gutenprint's post-install message)

=== Other ===

==== Printer "Paused" or "Stopped" with Status "Rendering completed" ====

When low on ink, some printers will get stuck in "Rendering completed" status and, if it is a network printer, the printer may even become unreachable from CUPS' perspective despite being properly connected to the network. Replacing the low/depleted ink cartridge(s) in this setting will return the printer to "Ready" status and, if it is a network printer, will make the printer available to CUPS again.

{{Note|If you use third-party ink cartridges, the ink levels reported by the printer may be inaccurate. If you use third-party ink and your printer used to work fine but is now getting stuck on "Rendering completed" status, replace the ink cartridges regardless of the reported ink levels before trying other fixes.}}

If low ink is not the issue, check the "Group ID" of files in {{ic|/etc/cups}}, {{ic|/var/log/cups}}, and, if you have "root" permission, {{ic|/var/spool/cups}}. The files should have GID {{ic|lp}}. If some files have GID {{ic|nobody}}, then check the named groups in the "Group" and "SystemGroup" directives in the file {{ic|/etc/cups/cups-files.conf}}. Typically there will be {{ic|Group lp}} and {{ic|SystemGroup lpadmin sys root}}. Make sure that the group in "Group" is NOT also in "SystemGroup". In particular, make sure that the name {{ic|lp}} is NOT listed in the "SystemGroup" directive, when it is used in the "Group" directive. This is counter to recommendations made in the CUPS and KDE wiki pages in the past. If you had added {{ic|lp}} to the "SystemGroup" directive, as had been suggested, remove {{ic|lp}} from the "SystemGroup", or run the following command and change {{ic|lp}} to {{ic|lpadmin}} in the "SystemGroup" directive.

# groupadd -g107 lpadmin

===== Explanation of the GID issue =====

For security reasons, {{ic|cupsd}} does not allow external CUPS helper programs, which are run with the GID selected with the "Group" directive, to run with any GID of the administrative groups, which are those GIDs listed in the "SystemGroup" directive. If the named group in the Group directive is also in the SystemGroup directive, then {{ic|cupsd}} will instead run the helper programs with GID {{ic|nobody}}, without warning. Note that the printer devices in {{ic|/dev/}}, for instance {{ic|/dev/parport0}}, are created with user {{ic|root}} and group {{ic|lp}}. When {{ic|cupsd}} then tries to print, it "pauses" or "stops" because it does not have permission to write the printer device file, and does not provide any useful error message. The printer device files can be made "world writable" to bypass the problem, but that is insecure and is not the proper solution.

As of CUPS version 2.0.0-2, if the group in the Group directive is also in the SystemGroup directive, {{ic|cupsd}} will exit immediately after starting, and, at a log level of "notice" or higher, will log an error message to the default error log, but not to the system log.

{{hc|/var/log/cups/error_log|Group and SystemGroup cannot use the same groups.}}

This solves the problem of {{ic|cupsd}} running in a non-functional state and failing to print without explanation.

At the default log level of "warn", no group collision error message is logged. To see this error message, increase the log level to "notice", "info", "debug", or "debug2".

{{hc|/etc/cups/cupsd.conf|LogLevel notice}}

Error messages can be sent to the systemd-journald log instead of to the default {{ic|/var/log/cups/error_log}}, but not to both, by explicitly setting the ErrorLog directive.

{{hc|/etc/cups/cups-files.conf|ErrorLog syslog}}

Currently, even then, the command {{ic|systemctl status org.cups.cupsd.service}} will not properly display the final group collision error message, but the error message can still be seen in the journal, with for instance, {{ic|sudo journalctl -f}}.

==== CUPS permission errors ====

* Some users fixed 'NT_STATUS_ACCESS_DENIED' (Windows clients) errors by using a slightly different syntax:

smb://workgroup/username:password@hostname/printer_name

* Sometimes, the block device has wrong permissions:

# ls /dev/usb/

lp0

# chgrp lp /dev/usb/lp0

==== HPLIP printer sends "/usr/lib/cups/backend/hp failed" error ====

Make sure dbus is installed and running. If the error persists, try starting avahi-daemon.

Try adding the printer as a Network Printer using the http:// protocol. Generate the printer URI with {{ic|hp-makeuri}}.

{{Note|There might need to set permissions issues right. Follow indications here: [[CUPS#Device node permissions]].}}

==== HPLIP printer claims job is complete but printer does nothing ====

This happens on HP printers when you select the (old) hpijs driver (e.g. the Deskjet D1600 series). Instead, use the hpcups driver when adding the printer.

Some HP printers (e.g HP LaserJet) require their firmware to be downloaded from the computer every time the printer is switched on. If there is an issue with udev (or equivalent) and the firmware download rule is never fired, you may experience this issue.

As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter

hp-firmware -n

==== hp-setup asks to specify the PPD file for the discovered printer ====

Install CUPS before running hp-setup.

==== I have installed Qt, but hp-setup reports "Qt/PyQt 4 initialization failed" ====

"hp-check -t" will not give you useful information to find the required package. You have to install all the "Dependent Packages" prefixed with "python2" in {{Pkg|hplip}}

==== hp-setup finds the printer automatically but reports "Unable to communicate with device" when printing test page immediately afterwards ====

This at least happens to hplip 3.13.5-2 for HP Officejet 6500A through local network connection. To solve the problem, specify the IP address of the HP printer for hp-setup to locate the printer.

==== hp-toolbox sends an error, "Unable to communicate with device" ====

If running hp-toolbox as a regular user results in:

# hp-toolbox

# error: Unable to communicate with device (code=12): hp:/usb/''printer id''

or, "{{ic|Unable to communicate with device"}}", then it may be needed to [[Groups#Group management|add the user to the lp and sys groups]].

This can also be caused by printers such as the P1102 that provide a virtual CD-ROM drive for MS Windows drivers. The lp dev appears and then disappears. In that case, try the '''usb-modeswitch''' and '''usb-modeswitch-data''' packages, that lets one switch off the "Smart Drive" (udev rules included in said packages).

This can also occur with network attached printers if the [[Avahi|avahi-daemon]] is not running. Another possibility is the specification of the printer's IP address in ''hp-setup'' fails to locate the printer because the IP address of the the printer changed due to DHCP. If this is the case, consider adding a DHCP reservation for the printer in the DHCP server's configuration.

==== CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer ====

If receiving any of the following error messages in {{ic|/var/log/cups/error_log}} while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':

Filter "foomatic-rip" for printer ''printer_name'' not available: No such file or director

or:

PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!

make sure {{pkg|hplip}} has been [[pacman|installed]], in addition to [[#Packages|the packages mentioned above]]. See [https://bbs.archlinux.org/viewtopic.php?id=65615 this forum post] for more information.

==== Printing fails with unauthorised error ====

If the user has been added to the lp group, and allowed to print (set in {{ic|cupsd.conf}}), then the problem lies in {{ic|/etc/cups/printers.conf}}. This line could be the culprit:

AuthInfoRequired negotiate

Comment it out and restart CUPS.

==== Unknown supported format: application/postscript ====

Comment the lines:

application/octet-stream application/vnd.cups-raw 0 -

from {{ic|/etc/cups/mime.convs}}, and:

application/octet-stream

in {{ic|/etc/cups/mime.types}}.

==== Finding URIs for Windows print servers ====

Sometimes Windows is a little less than forthcoming about exact device URIs (device locations). If having trouble specifying the correct device location in CUPS, run the following command to list all shares available to a certain windows username:

$ smbtree -U ''windowsusername''

This will list every share available to a certain Windows username on the local area network subnet, as long as Samba is set up and running properly. It should return something like this:

{{bc| WORKGROUP

\\REGULATOR-PC

\\REGULATOR-PC\Z

\\REGULATOR-PC\Public

\\REGULATOR-PC\print$ Printer Drivers

\\REGULATOR-PC\G

\\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series}}

What is needed here is first part of the last line, the resource matching the printer description. So to print to the EPSON Stylus printer, one would enter:

smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series

as the URI into CUPS.

If you have special characters (eg *, \) in your username, password or server address, you need to urlencode them. For example,

smb://WIN-DOMAIN.COM\username:passw*rd@WIN-DOMAIN.COM/domain.com/printer

must be written as

smb://WIN-DOMAIN.COM%5Cusername:passw%2Ard@WIN-DOMAIN.COM/domain.com/printer

To encode the URI, one can use [http://www.url-encode-decode.com/ an online service], [https://docs.python.org/2/library/urllib.html#urllib.urlencode python] or something else.

==== Print-Job client-error-document-format-not-supported ====

Try installing the foomatic packages and use a foomatic driver.

==== Unable to get list of printer drivers ====

* Check the {{ic|ServerName}} in {{ic|/etc/cups/client.conf}} is written without http://

ServerName localhost:631

* Try to remove Foomatic drivers or refer to [[#HP Printer]] for a workaround.

==== lp: Error - Scheduler Not Responding ====

If you get this error when printing a document using:

$ lp document-to-print

Try setting the {{ic|CUPS_SERVER}} environment variable:

$ export CUPS_SERVER=localhost

If this solves your problem, make the solution permanent by adding the export line above to {{ic|~/.bash_profile}}.

==== CUPS prints only an empty and an error-message page on HP LaserJet ====

There is a bug that causes CUPS to fail when printing images on HP LaserJet (in my case 3380). The bug has been reported and fixed by [https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/998087 Ubuntu].

The first page is empty, the second page contains the following error message:

ERROR:

invalidaccess

OFFENDING COMMAND:

filter

STACK:

/SubFileDecode

endstream

...

In order to fix the issue, run the following command as root:

# lpadmin -p ''printer'' -o pdftops-renderer-default=pdftops

==== "Using invalid Host" error message ====

Try adding {{ic|ServerAlias *}} into {{ic|/etc/cups/cupsd.conf}}.

==== Printer does not print with an "Filter failed" message on CUPS web interface (HP printer) ====

{{Accuracy|{{ic|chmod 666}} on a system device sounds dubious to say the least}}

Change the permissions of the printer USB port. Get the bus and device number from {{ic|lsusb}}, then set the permission using:

{{hc| lsusb |

Bus <BUSID> Device <DEVID>: ID <PRINTERID>:<VENDOR> Hewlett-Packard DeskJet D1360}}

Then substitute the provided device information to the

# chmod 0666 /dev/bus/usb/<BUSID>/<DEVID>

To make the persistent permission change that will be triggered automatically each time the computer is rebooted, add the following line.

{{hc|/etc/udev/rules.d/10-local.rules|2=

SUBSYSTEM=="usb", ATTRS{idVendor}=="<VENDOR>", ATTRS{idProduct}=="<PRINTERID>", GROUP="lp", MODE:="666"

}}

Each system may vary, so consult [[udev#List_attributes_of_a_device]] wiki page.

==== Printer does not print with a "Filter failed" message on CUPS web interface (HP printer connected over network) ====

Start, enable, and restart the {{ic|avahi-daemon}} service.

==== HPLIP 3.13: Plugin is installed, but HP Device Manager complains it is not ====

The issue might have to do with the file permission change that had been made to {{ic|/var/lib/hp/hplip.state}}. To correct the issue, a simple {{ic|chmod 644 /var/lib/hp/hplip.state}} and {{ic|chmod 755 /var/lib/hp}} should be sufficient. For further information, please read this [https://bugs.launchpad.net/hplip/+bug/1131596 link].

==== Printer is not recognized by CUPS ====

If your printer is not listed in the "Add Printers" page of the CUPS web interface, nor by {{ic|lpinfo -v}}, try the following (suggested in [https://bbs.archlinux.org/viewtopic.php?pid=1037279#p1037279 this thread]):

* Remove {{ic|usblp}} from blacklist

* Load {{ic|usblp}} module

# modprobe usblp

* Stop CUPS

* Add the following udev rule in a new rule file:

{{hc|/etc/udev/rules.d/10-cups_device_link.rules|2=

KERNEL=="lp[0-9]", SYMLINK+="%k", GROUP="lp"

}}

* Reload udev rules:

# udevadm control --reload-rules

* Unplug the printer, and plug it in again.

* Wait a few seconds, and then start the CUPS service.

==== Cannot load /etc/samba/smb.conf ====

If you are printing to a remote printer over SMB and get this error message: "Can't load /etc/samba/smb.conf - run testparm to debug it", then create an empty {{ic|/etc/samba/smb.conf}} file:

# mkdir /etc/samba

# touch /etc/samba/smb.conf

and restart the CUPS service.

==== CUPS identifies printer but cannot connect to it ====

{{Poor writing|No workaround or origin provided}}

Enable debug logging. If you see {{ic|Executing backend "/usr/lib/cups/backend/dnssd"...}} over and over switch from dnssd to socket in the printer configuration.

Example: {{ic|socket://192.168.11.6:9100}}. The port number can be confirmed via [[nmap]] or {{ic|telnet ''your-printer-ip'' 9100}}.

Show more