From Fedora Project Wiki

(→‎Driver: Foomatic debugging)
m (→‎Other information to include: Better link format)
(24 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''Foreword'''
'''Foreword'''


If you experiencing a problem with printing, please take a look at the [[Bugs/Common|common bugs]] page before filing a bug.  If the problem you are seeing is not listed there or none of the workarounds seem to help, please consider [[#Filing_a_bug_report|filing a bug report]] to help us make Fedora run better on your hardware.
If you are experiencing a problem with printing, please take a look at the [[Bugs/Common|common bugs]] page before filing a bug.  If the problem you are seeing is not listed there or none of the workarounds seem to help, please consider [[#Filing_a_bug_report|filing a bug report]] to help us make Fedora run better on your hardware.


== Identifying your problem area ==
== Identifying your problem area ==
Line 7: Line 7:
=== Printing troubleshooter ===
=== Printing troubleshooter ===


The first thing to try is to run the printing troubleshooter: ''System > Administration > Printing'' from the main menu, then ''Help > Troubleshoot'' from the menu bar.  This will ask a series of questions about the problem you are experiencing, with the aim of finding the reason for the problem.
The first thing to try is to run the printing troubleshooter.  First run system-config-printer:
 
* ''Applications'' > ''Other'' > ''Printing'' from the GNOME Shell overview (Fedora 15 and later), or
* ''System > Administration > Printing'' from the GNOME menu (Fedora 14 and earlier).
 
Then ''Help > Troubleshoot'' from the menu bar.  This will ask a series of questions about the problem you are experiencing, with the aim of finding the reason for the problem.
 
After following this process you will most likely end up with a {{filename|troubleshoot.txt}} file.  '''This is the most helpful thing you can add to a bug report.'''


One step in this process is to print a test page.  There is a button in the troubleshooter to print a test page for you, but if the problem you are seeing is specific to printing from a certain application, or printing a certain document, just go ahead and print from that application or print that particular document.  The print job will appear in the troubleshooting window -- just put a tick in the box next to that print job to say that it is the one you are having trouble with.
One step in this process is to print a test page.  There is a button in the troubleshooter to print a test page for you, but if the problem you are seeing is specific to printing from a certain application, or printing a certain document, just go ahead and print from that application or print that particular document.  The print job will appear in the troubleshooting window -- just put a tick in the box next to that print job to say that it is the one you are having trouble with.


If the problem was not found automatically you will be given the option to save the diagnostic information collected during the troubleshooting process in a file named {{filename|troubleshoot.txt}}.  If you report a bug you should attach this file,  not compressed, with the MIME type set as text/plain.
If the problem was not found automatically you will be given the option to save the diagnostic information collected during the troubleshooting process in a file named {{filename|troubleshoot.txt}}.  If you report a bug you should attach this file,  not compressed, with the MIME type set as text/plain.
==== Getting debug information by other means ====
If you are unable to use the printing troubleshooter for whatever reason, here are the steps to follow in order to get debugging information.
1. Enable full debugging information with:
<pre>
su -c 'cupsctl LogLevel=debug2'
</pre>
2. Clear out the {{filename|error_log}} file with:
''Fedora 16:''
<pre>
su -c '/sbin/systemctl stop cups.service'
su -c '>/var/log/cups/error_log'
su -c '/sbin/systemctl start cups.service'
</pre>
''Fedora 15 and older:''
<pre>
su -c '/sbin/service cups restartlog'
</pre>
3. You will now get debugging information sent to {{filename|/var/log/cups/error_log}} as you print files etc.
4. To turn off debugging information, do this:
<pre>
su -c 'cupsctl --no-debug-logging'
</pre>
5. {{filename|/var/log/cups/error_log}} is not world-readable, but the default CUPS configuration allows you to fetch it like this:
<pre>
wget http://localhost:631/admin/log/error_log
</pre>


=== What make and model is my printer? ===
=== What make and model is my printer? ===
Line 21: Line 63:
</pre>
</pre>


This will output a series of blocks of lines, each one like this:
This command runs each of the backends in discovery mode, to get them to report devices they can automatically detect.  This will output a series of blocks of lines, each one like this:


<pre>
<pre>
Line 35: Line 77:


The line which identifies this particular model type is the long one that starts "device-id =" (shown here wrapping over three lines).
The line which identifies this particular model type is the long one that starts "device-id =" (shown here wrapping over three lines).
Note that if your printer cannot be automatically detected, you may still be able to find out the Device ID by running the appropriate backend with the printer hostname as the argument.  The '''usb''', '''parallel''', '''snmp''', and '''dnssd''' backends all try to report the actual Device ID given by the printer.
<pre>
$ /usr/lib/cups/backend/snmp 10.34.18.3
network socket://10.34.18.3 "HP Color LaserJet CP2025dn" "HP Color LaserJet CP2025dn"
"MFG:Hewlett-Packard;CMD:PJL,PML,PCLXL,POSTSCRIPT,PCL;MDL:HP Color LaserJet CP2025dn;
CLS:PRINTER;DES:Hewlett-Packard Color LaserJet CP2025dn;MEM:MEM=55MB;COMMENT:RES=600x8;" "HP Color LaserJet CP2025dn"
</pre>
Device ID is in this case (see [http://www.cups.org/documentation.php/doc-1.5/man-backend.html backend(7)]) the last but one field.


=== Which driver am I using? ===
=== Which driver am I using? ===
Line 41: Line 94:


<pre>
<pre>
grep '^*NickName:' /etc/cups/ppd/Charlie.ppd
grep -H '^*NickName:' /etc/cups/ppd/*.ppd
</pre>
</pre>


Line 59: Line 112:


If you are having problems printing PDF files, try printing other types of file to see if the problem is with printing anything or if it is specific to printing PDF files.  Try converting the file to a different format and printing that.
If you are having problems printing PDF files, try printing other types of file to see if the problem is with printing anything or if it is specific to printing PDF files.  Try converting the file to a different format and printing that.
If the problem relates to printing text files, try removing/installing the paps package.  This package provides an alternative text-to-PostScript filter to the one that comes with CUPS.
===== Running filters by hand =====
More advanced users may like to try running the CUPS filters by hand and examining the data file at each step as it is converted between different formats.  Here is an example of doing this for a gutenprint queue named pqueue with the CUPS test page which is its own special MIME type, application/vnd.cups-banner:
<pre>
export PPD=/etc/cups/ppd/pqueue.ppd
# This queue's filter pipeline for application/vnd.cups-banner is:
#  bannertops | pstops | pstoraster | rastertogutenprint.5.2
/usr/lib/cups/filter/bannertops 1 tim '' 1 '' </usr/share/cups/data/testprint >bannertops.ps
/usr/lib/cups/filter/pstops 1 tim '' 1 '' <bannertops.ps >pstops.ps
/usr/lib/cups/filter/pstoraster 1 tim '' 1 ''<pstops.ps >pstoras.ras
/usr/lib/cups/filter/rastertogutenprint.5.2 1 tim '' 1 ''<pstops.ras >out.prn
</pre>
Here, {{command|gs}} or {{command|evince}} can be used to examine the output after the first two filters, {{command|rasterview}} can be used to examine the output of the third filter, and the last filter's output must be inspected by hand or sent directly to the printer.


==== Driver ====
==== Driver ====


There is often a choice of drivers to use, and trying each one in turn can be useful in narrowing down the problem.  See [[#Which_driver_am_I_using.3F|above]] for how to do that.
If you have access to a different make/model of printer it might be worth trying to see if the problem occurs on both of them or just one.  This can give an indication about whether it is a problem with a particular driver, or if it is a more general problem.
 
Even if you only have access to the one printer there is often a choice of drivers to use for a given printer model, and trying each one in turn can be useful in narrowing down the problem.  See [[#Which_driver_am_I_using.3F|above]] for how to do that.
 
===== Foomatic =====


For Foomatic drivers you can try enabling Foomatic debugging by editing the file {{{filename|/etc/foomatic/filter.conf}}} and adding a line:
For Foomatic drivers you can try enabling Foomatic debugging by editing the file {{{filename|/etc/foomatic/filter.conf}}} and adding a line:
Line 82: Line 157:
* '''smb''' is for CIFS shares from Windows systems
* '''smb''' is for CIFS shares from Windows systems
* '''ipp''' is for Internet Printing Protocol-enabled devices and also for other CUPS servers
* '''ipp''' is for Internet Printing Protocol-enabled devices and also for other CUPS servers
** You can capture the IPP traffic with tcpdump like this (the interface name may differ from '''p4p1'''):
  tcpdump -n -i p4p1 -U -s0 -w ipp.pcap port ipp
* '''bjnp''' is for Canon's proprietary bjnp network protocol (usually port 8611)


==== Configuration tool ====
==== Configuration tool ====


If your problem relates to configuring print queues, try using one of the other methods of doing so.  There are three available:
If your problem relates to configuring print queues, try using one of the other methods of doing so.  There are four available:


* '''system-config-printer''', ''System > Administration > Printing'' from the main menu
* The GNOME 3 System Settings application ('''control-center'''), ''System Settings > Printers'' from the GNOME Shell
* '''system-config-printer''', ''System > Administration > Printing'' from the GNOME menu
* the CUPS web interface, [http://localhost:631/ http://localhost:631/]
* the CUPS web interface, [http://localhost:631/ http://localhost:631/]
* the command line tools '''lpadmin''', '''lpoptions''', '''cupsctl''', '''cupsaccept''', '''cupsenable''' etc.
* the command line tools '''lpadmin''', '''lpoptions''', '''cupsctl''', '''cupsaccept''', '''cupsenable''' etc.
Line 97: Line 176:
Problems involving printing may relate to several components.
Problems involving printing may relate to several components.


The configuration GUI is [https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=system-config-printer system-config-printer].  This package also provides the printer applet and handles automatic queue creation, and disables/enables queues when USB printers are disconnected and reconnected.
The configuration GUI (See [[#Configuration_tool|above]]) is either [https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=control-center GNOME 3 System Settings application] or [https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=system-config-printer system-config-printer].  These packages also provide the printer applet, handle automatic queue creation, and disable/enable queues when USB printers are disconnected and reconnected.


Most GTK+ applications use the GTK+ print dialog.  If the problem occurs when using GTK+ applications but not when printing from the command line or from another non-GTK+ application, the problem should probably be reported against [https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=gtk2 gtk2].  If the problem occurs with only one GTK+ application, and other GTK+ applications print fine, the bug should be filed against that particular application.
Most GTK+ applications use the GTK+ print dialog.  If the problem occurs when using GTK+ applications but not when printing from the command line or from another non-GTK+ application, the problem should probably be reported against [https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=gtk2 gtk2].  If the problem occurs with only one GTK+ application, and other GTK+ applications print fine, the bug should be filed against that particular application.
Line 122: Line 201:
* the PPD file for the print queue (from the {{filename|/etc/cups/ppd}} directory)
* the PPD file for the print queue (from the {{filename|/etc/cups/ppd}} directory)
* the document you are attempting to print -- if this is large, please try to see if the problem also occurs with a smaller document
* the document you are attempting to print -- if this is large, please try to see if the problem also occurs with a smaller document
Some example documents can be found in [[:Category:Printing_Test_Cases|the Printing Test Cases category]].
=== Further reading ===
The [[Printing|main printing page]] has more information about how printing works in Fedora.


[[Category:Debugging|P]] [[Category:How to]]
[[Category:Debugging|P]] [[Category:How to]]

Revision as of 13:12, 23 February 2012

Foreword

If you are experiencing a problem with printing, please take a look at the common bugs page before filing a bug. If the problem you are seeing is not listed there or none of the workarounds seem to help, please consider filing a bug report to help us make Fedora run better on your hardware.

Identifying your problem area

Printing troubleshooter

The first thing to try is to run the printing troubleshooter. First run system-config-printer:

  • Applications > Other > Printing from the GNOME Shell overview (Fedora 15 and later), or
  • System > Administration > Printing from the GNOME menu (Fedora 14 and earlier).

Then Help > Troubleshoot from the menu bar. This will ask a series of questions about the problem you are experiencing, with the aim of finding the reason for the problem.

After following this process you will most likely end up with a troubleshoot.txt file. This is the most helpful thing you can add to a bug report.

One step in this process is to print a test page. There is a button in the troubleshooter to print a test page for you, but if the problem you are seeing is specific to printing from a certain application, or printing a certain document, just go ahead and print from that application or print that particular document. The print job will appear in the troubleshooting window -- just put a tick in the box next to that print job to say that it is the one you are having trouble with.

If the problem was not found automatically you will be given the option to save the diagnostic information collected during the troubleshooting process in a file named troubleshoot.txt. If you report a bug you should attach this file, not compressed, with the MIME type set as text/plain.

Getting debug information by other means

If you are unable to use the printing troubleshooter for whatever reason, here are the steps to follow in order to get debugging information.

1. Enable full debugging information with:

su -c 'cupsctl LogLevel=debug2'

2. Clear out the error_log file with:

Fedora 16:

su -c '/sbin/systemctl stop cups.service'
su -c '>/var/log/cups/error_log'
su -c '/sbin/systemctl start cups.service'

Fedora 15 and older:

su -c '/sbin/service cups restartlog'

3. You will now get debugging information sent to /var/log/cups/error_log as you print files etc.

4. To turn off debugging information, do this:

su -c 'cupsctl --no-debug-logging'

5. /var/log/cups/error_log is not world-readable, but the default CUPS configuration allows you to fetch it like this:

wget http://localhost:631/admin/log/error_log

What make and model is my printer?

Each different printer has a model-specific Device ID. The printing troubleshooter attempts to collect this information from the printer, but you can do it yourself with the lpinfo command:

su -c "lpinfo -l -v"

This command runs each of the backends in discovery mode, to get them to report devices they can automatically detect. This will output a series of blocks of lines, each one like this:

Device: uri = usb://HP/DESKJET%20990C?serial=U123456789AB
        class = direct
        info = HP DESKJET 990C
        make-and-model = HP DESKJET 990C
        device-id = MFG:HEWLETT-PACKARD;MDL:DESKJET 990C;CMD:MLC,PCL,PML;CLS:PRI
NTER;DES:Hewlett-Packard DeskJet 990C;SN:U123456789AB;S:00808880800010032C100000
0C2000000;P:0800,FL,B0;J:                    ;
        location = 

The line which identifies this particular model type is the long one that starts "device-id =" (shown here wrapping over three lines).

Note that if your printer cannot be automatically detected, you may still be able to find out the Device ID by running the appropriate backend with the printer hostname as the argument. The usb, parallel, snmp, and dnssd backends all try to report the actual Device ID given by the printer.

$ /usr/lib/cups/backend/snmp 10.34.18.3

network socket://10.34.18.3 "HP Color LaserJet CP2025dn" "HP Color LaserJet CP2025dn"
"MFG:Hewlett-Packard;CMD:PJL,PML,PCLXL,POSTSCRIPT,PCL;MDL:HP Color LaserJet CP2025dn;
CLS:PRINTER;DES:Hewlett-Packard Color LaserJet CP2025dn;MEM:MEM=55MB;COMMENT:RES=600x8;" "HP Color LaserJet CP2025dn" 

Device ID is in this case (see backend(7)) the last but one field.

Which driver am I using?

The PPD file for the printer queue can tell you which driver is in use. For a queue called Charlie, you can use this command to find out which driver is being used:

grep -H '^*NickName:' /etc/cups/ppd/*.ppd

You can also find this out using the system-config-printer application. Double-click on the icon for the queue and look at the Make and Model field.

To see the available drivers, click on the Change... button next to that field. You might find it useful to try another driver to see if that shows the same problem.

Finding where the problem lies

When a print job is processed it is sent through a chain of filters to convert the file into a format the printer can understand, and then finally sent to a backend, a program which can transport the data to the printer. By slightly changing how you print you can try a different printing path to see if that changes anything. If it works around the problem, you know which area the problem was in -- include that information in a bug report so that we can fix it.

Application

Try printing from a different application to see if the problem goes away or if it occurs regardless of how a file is printed. Try printing the document from the command line using the lp command.

Document format

If you are having problems printing PDF files, try printing other types of file to see if the problem is with printing anything or if it is specific to printing PDF files. Try converting the file to a different format and printing that.

If the problem relates to printing text files, try removing/installing the paps package. This package provides an alternative text-to-PostScript filter to the one that comes with CUPS.

Running filters by hand

More advanced users may like to try running the CUPS filters by hand and examining the data file at each step as it is converted between different formats. Here is an example of doing this for a gutenprint queue named pqueue with the CUPS test page which is its own special MIME type, application/vnd.cups-banner:

export PPD=/etc/cups/ppd/pqueue.ppd
# This queue's filter pipeline for application/vnd.cups-banner is:
#   bannertops | pstops | pstoraster | rastertogutenprint.5.2
/usr/lib/cups/filter/bannertops 1 tim '' 1 '' </usr/share/cups/data/testprint >bannertops.ps
/usr/lib/cups/filter/pstops 1 tim '' 1 '' <bannertops.ps >pstops.ps
/usr/lib/cups/filter/pstoraster 1 tim '' 1 ''<pstops.ps >pstoras.ras
/usr/lib/cups/filter/rastertogutenprint.5.2 1 tim '' 1 ''<pstops.ras >out.prn

Here, gs or evince can be used to examine the output after the first two filters, rasterview can be used to examine the output of the third filter, and the last filter's output must be inspected by hand or sent directly to the printer.

Driver

If you have access to a different make/model of printer it might be worth trying to see if the problem occurs on both of them or just one. This can give an indication about whether it is a problem with a particular driver, or if it is a more general problem.

Even if you only have access to the one printer there is often a choice of drivers to use for a given printer model, and trying each one in turn can be useful in narrowing down the problem. See above for how to do that.

Foomatic

For Foomatic drivers you can try enabling Foomatic debugging by editing the file /etc/foomatic/filter.conf and adding a line:

debug: 1

Next time you print a job to a queue using foomatic the debugging will be put in /tmp/foomatic-rip.log, and the input file as received by foomatic-rip will be in /tmp/foomatic-rip.ps.

Backend (job transport)

It may be possible for you to try a different backend. Using system-config-printer, double-click on the printer queue icon and click the Change... button next to the Device URI field. You may see a Connection expander arrow near the bottom right hand corner of the window -- click that to see which backends are available. For USB-connected HP printers, typically either of the hp and usb backends can be used.

For network printers you may have different protocols you can try.

  • socket is for HP JetDirect (usually port 9100)
  • lpd is for older style UNIX print shares
  • smb is for CIFS shares from Windows systems
  • ipp is for Internet Printing Protocol-enabled devices and also for other CUPS servers
    • You can capture the IPP traffic with tcpdump like this (the interface name may differ from p4p1):
 tcpdump -n -i p4p1 -U -s0 -w ipp.pcap port ipp
  • bjnp is for Canon's proprietary bjnp network protocol (usually port 8611)

Configuration tool

If your problem relates to configuring print queues, try using one of the other methods of doing so. There are four available:

  • The GNOME 3 System Settings application (control-center), System Settings > Printers from the GNOME Shell
  • system-config-printer, System > Administration > Printing from the GNOME menu
  • the CUPS web interface, http://localhost:631/
  • the command line tools lpadmin, lpoptions, cupsctl, cupsaccept, cupsenable etc.

Filing a bug report

Deciding which component

Problems involving printing may relate to several components.

The configuration GUI (See above) is either GNOME 3 System Settings application or system-config-printer. These packages also provide the printer applet, handle automatic queue creation, and disable/enable queues when USB printers are disconnected and reconnected.

Most GTK+ applications use the GTK+ print dialog. If the problem occurs when using GTK+ applications but not when printing from the command line or from another non-GTK+ application, the problem should probably be reported against gtk2. If the problem occurs with only one GTK+ application, and other GTK+ applications print fine, the bug should be filed against that particular application.

If the problem only happens with PDF files, the bug may well be in poppler (the CUPS pdftops filter is a wrapper around one of the poppler utility programs).

Report bugs only seen using the smb backend against samba.

For bugs only seen when using the hp backend, or the hpijs or hpcups drivers, select hplip for the component.

Other possibilities, depending on the problem, include:

  • foomatic (the Foomatic CUPS filter and driver)
  • foomatic-db (the actual printer database used by Foomatic)
  • ghostscript (which converts PostScript to other formats)
  • gutenprint (a driver that supports very many printers)

For anything else, or if you are not sure, choose cups or use your best guess.

Other information to include

Be prepared to include some information about your system as well. Some of this can be gathered automatically using the printing troubleshooter, but you may also need to include other information such as:

  • the PPD file for the print queue (from the /etc/cups/ppd directory)
  • the document you are attempting to print -- if this is large, please try to see if the problem also occurs with a smaller document

Some example documents can be found in the Printing Test Cases category.

Further reading

The main printing page has more information about how printing works in Fedora.