From Fedora Project Wiki

(→‎Document format: Explain PreserveJobFiles procedure)
 
(48 intermediate revisions by 4 users not shown)
Line 5: Line 5:
 
== Identifying your problem area ==
 
== Identifying your problem area ==
  
=== Printing troubleshooter ===
+
Printing issues can be fairly complex and active cooperation or lots of data can be requested from reporter by maintainer to helping maintainer to at least understand and (if it is not hardware specific issue) reproduce the issue, so please have a patience and try to narrow the problem as much you are able to for maintainers.
  
The first thing to try is to run the printing troubleshooter.
+
There can be:
Install system-config-printer:
+
* issues with seeing or connecting to the printer (it can be cups backend issues, avahi issues, libusb issues, cups-browsed issues),
 +
* accessibility issues (correct/wrong setup in cupsd.conf or its bad interpretation by cupsd daemon, bad cooperation with NIS, SSSD...),
 +
* printing with help of samba (issues with smb backend, which is part of samba) or with samba authenticated through Kerberos (samba_krb5_printing),
 +
* issues with filters used during filtering the document into document format supported by printer, which influence how or if the document will be printed (issue with filters - pdftops, pdftopdf, pstops, bannertopdf etc. - or issues with binaries or libraries which filters uses - libgs, qpdf, poppler...),
 +
* issues with Postscript Printer Description files, which are old way of defining printers capabilities like supported page sizes, borders etc...
 +
 
 +
Not mentioning possible limitations or issues in firmware or hardware of printer itself, so any kind of data or narrowing the issue is welcomed.
 +
 
 +
The best start is to attach files with logs described further down.
 +
 
 +
=== CUPS logging ===
 +
 
 +
All CUPS logging is redirected to journal by default since Fedora 28 (there was a redirecting of error_log to journal by default before Fedora 28, since Fedora 20). Printing troubleshooter doesn't have a feature to get logs from systemd journal yet, so CUPS logs need to be acquired by following steps.
 +
 
 +
We need to define two different ways of capturing incident-bound CUPS whole logs - the one if the broken print queue isn't provided by HPLIP and the other if it is. They differs in the filter option of journald - if you use non-HPLIP queue for debugging, it is okay to gather the logs from cups systemd unit (by '-u cups'), because all error messages are correctly redirected to cups systemd unit logging and they are accessible in the output after unit filtering. HPLIP libraries are not implemented to do the same (upstream is unresponsive to accept a potencial fix into the project and the issue is not critical enough to drag a downstream patch forever), so their messages aren't marked for cups systemd unit and they're filtered out after calling journald with '-u cups'. For such queues journald log without filtering is required.
 +
 
 +
'''Note:'''
 +
 
 +
Incident-bound journald log without filtering is required only for HPLIP print queues (their device uri starts with hp://) and it is unwanted for other queues, because it can be hard to read in larger cases. Please attach incident-bound journald log only when it is necessary.
 +
 
 +
==== Location of CUPS logging ====
 +
 
 +
CUPS logging is located in the system journal by default, but the logging into a file can be set in /etc/cups/cups-files.conf with directive 'ErrorLog'. If you want to change the default settings, then the name of the logging file is irrelevant, but it is recommended to put the file into path '/var/log/cups', otherwise SELinux will block cupsd from accessing it.
 +
 
 +
Setting the logging to a file has following cons (without further operations):
 +
* unable to get only logs connected to a job without chaining more commands
 +
* unable to get logs for specified time frame without chaining more commands
 +
 
 +
For capturing a incident-bound logs 'tail -f' can be used e.g.:
 +
<pre>
 +
tail -f /var/log/cups/error_log
 +
</pre>
 +
 
 +
==== Enable CUPS debug logging ====
 +
 
 +
Enable full debugging information with:
 
<pre>
 
<pre>
su -c 'yum install system-config-printer'
+
su -c 'cupsctl --debug-logging'
 
</pre>
 
</pre>
Start the ''Print Settings'' application, or else you can run it from the command line:
+
 
 +
==== CUPS job log ====
 +
'''IMPORTANT''' If the problem appears when you sent document to print or if you are trying to, capture logs for this job. If the job log is available, its attaching is '''REQUIRED'''.
 +
 
 +
===== Prepare CUPS for job logging =====
 +
 
 +
For being able to see specific job log, please turn on:
 +
 
 
<pre>
 
<pre>
system-config-printer
+
PreserveJobFiles Yes
 
</pre>
 
</pre>
  
Then select ''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.
+
in your /etc/cups/cupsd.conf file and restart cup service. Do not forget to remove the line after you are done with debugging. 'lpstat -W all' seems to be empty after printing if you do not enable the directive.
 +
 
 +
===== Get a job log for a specific Job ID =====
 +
 
 +
To capture job log you need to know Job ID (JID) of the job - it is a number which together with print queue name specifies the job as request ID - for getting logs specific for the job.  
 +
 
 +
Job ID can be seen in terminal if you send a document to print by '''lp''' command:
 +
 
 +
<pre>
 +
$ lp -d <print_queue_name> <file1> ... <fileN>
 +
request id is <print_queue_name>-<JID> (N file(s))
 +
</pre>
  
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.'''
+
Or when you list jobs (see '''man lpstat''') - the latest job is at the end:
  
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.
+
<pre>
 +
$ lpstat -W all
 +
...
 +
<print_queue_name>-<JID>          <user>          1024  Wed 11 Jan 2017 05:52:19 PM CET
 +
</pre>
  
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.
+
You can get the latest job logs automatically (if you have '''awk''' installed and '''lpstat -W all''' returns jobs) by:
  
==== Getting debug information by other means ====
+
<pre>
 +
$ journalctl -u cups JID=`lpstat -W all | awk '{print $1}' | awk -F '-' '{print $NF}' | tail -n 1`
 +
</pre>
  
If you are unable to use the printing troubleshooter for whatever reason, here are the steps to follow in order to get debugging information.
+
Or manually, if you found JID by yourself:
  
1. Enable full debugging information with:
 
 
<pre>
 
<pre>
su -c 'cupsctl LogLevel=debug2'
+
journalctl -u cups JID=<JID> > cups_job_log
 
</pre>
 
</pre>
  
''The following step for Fedora 19 and 20 only:''
+
 
2. Clear out the {{filename|error_log}} file with:
+
==== Incident-bound cupsd log (broken print queue isn't HPLIP supported) ====
 +
 
 +
Sometimes we cannot bind the error with a specific print job, so the job log is uneffective. Incident-bound cupsd log is needed.
 +
 
 +
===== How to start to capture incident-bound cupsd logging =====
 +
 
 +
In new terminal/terminal tab, please issue:
  
 
<pre>
 
<pre>
su -c 'systemctl stop cups.service'
+
journalctl -f -u cups > cups_whole_log
su -c '>/var/log/cups/error_log'
 
su -c 'systemctl start cups.service'
 
 
</pre>
 
</pre>
  
3. Trigger the error condition you are trying to diagnose by e.g. printing something.
+
===== How to get incident-bound cupsd logging =====
 +
 
 +
After you trigger the error condition you are trying to diagnose e.g. printing something, try to find a printer via '''lpinfo''' etc., you terminate capturing incident-bound cupsd log from [[#How to start to capture incident-bound cupsd logging|step above]] by ctrl+c.
 +
 
 +
 
 +
==== Incident-bound cupsd log (broken print queue is HPLIP supported)====
 +
 
 +
Unfortunately, HPLIP libraries don't log into CUPS unit in journal, so if your print queue is installed with HPLIP driver (its device uri starts with '''hp://'''), we need incident-bound journal log.
 +
 
 +
===== How to start to capture incident-bound journal logging =====
 +
 
 +
In new terminal/terminal tab, please issue:
  
4. To turn off debugging information, do this:
 
 
<pre>
 
<pre>
su -c 'cupsctl --no-debug-logging'
+
journalctl -f > journal_whole_log
 
</pre>
 
</pre>
  
5. Fetch the log messages.
+
===== How to get incident-bound journal logging =====
 +
 
 +
After you trigger the error condition you are trying to diagnose e.g. printing something, running HP script etc., you terminate capturing incident-bound journal log from [[#How to start to capture incident-bound journal logging|step above]] by ctrl+c.
 +
 
 +
==== Turning off debug logging ====
  
'''Fedora 19 and 20:'''
+
Please attach {{filename|cups_job_log}} for the problematic job, {{filename|cups_whole_log}} or {{filename|journal_log}} if you caught whole cupsd log during the problematic event to bug report as an attachment.
  
{{filename|/var/log/cups/error_log}} is not world-readable, but the default CUPS configuration allows you to fetch it like this:
+
Then to turn off debugging information, do this:
 
<pre>
 
<pre>
wget http://localhost:631/admin/log/error_log
+
su -c 'cupsctl --no-debug-logging'
 
</pre>
 
</pre>
  
'''Fedora 21:'''
+
==== More commands for working with systemd-journald ====
  
 
View the log messages with:
 
View the log messages with:
 
<pre>
 
<pre>
journalctl _COMM=cupsd -e
+
journalctl -u cups -e
 
</pre>
 
</pre>
 
or:
 
or:
 
<pre>
 
<pre>
journalctl _COMM=cupsd --since=...
+
journalctl -u cups --since=...
 
</pre>
 
</pre>
 
To filter out messages relating to a specific job ID, use:
 
To filter out messages relating to a specific job ID, use:
 
<pre>
 
<pre>
journalctl CUPS_JOB_ID=...
+
journalctl -u cups JID=...
 
</pre>
 
</pre>
 
(tab completion will show you which job IDs have log messages)
 
(tab completion will show you which job IDs have log messages)
 +
 +
=== cups-browsed logging ===
 +
cups-browsed daemon was introduced in Fedora around cups-1.5 version. It can browse Bonjour broadcasts, CUPS broadcasts (deprecated) and LDAP servers for printers and create or remove local queues pointing to those printers. It can creates broadcasts of local CUPS queues, but it is marked as deprecated.
 +
 +
For setting debug logging on you need to add:
 +
<pre>
 +
DebugLogging stderr
 +
</pre>
 +
to /etc/cups/cups-browsed.conf.
 +
 +
The logs will be available in system journal after cups-browsed restart.
 +
 +
=== HPLIP scripts debug logging ===
 +
 +
Python scripts from HPLIP (e.g. '''hp-setup''', '''hp-clean''', '''hp-scan''') have debug logging redirected to the standard error file descriptor, so they are not logged in journal. For getting their debug logging, run the script with '''-ldebug''' parameter e.g.:
 +
 +
<pre>
 +
$ hp-setup -ldebug -i
 +
</pre>
 +
 +
and reproduce the issue. Then copy the messages from terminal into {{filename|hp_script_log}}. Please attach the file to the bugzilla ticket too.
  
 
=== What make and model is my printer? ===
 
=== What make and model is my printer? ===
  
Each different printer has a model-specific Device ID.  The [[#Printing_troubleshooter|printing troubleshooter]] attempts to collect this information from the printer, but you can do it yourself with the '''lpinfo''' command:
+
Each different printer has a model-specific Device ID.  You can find out with the '''lpinfo''' command:
  
 
<pre>
 
<pre>
Line 108: Line 205:
 
</pre>
 
</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.
 
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 print queues are available for me? ===
 +
 +
The queues on your machine can be permanent ones or temporary. CUPS is capable to list all available print queues on the local network (permanent and temporary queues) by:
 +
 +
<pre>
 +
$ lpstat -e
 +
</pre>
 +
 +
For permanent queues you are able to get more info with:
 +
 +
<pre>
 +
$ lpstat -t
 +
</pre>
  
 
=== Which driver am I using? ===
 
=== Which driver am I using? ===
Line 120: Line 231:
  
 
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.
 
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.
 +
 +
==== Driverless models ====
 +
 +
Most printers released since 2010 are capable of AirPrint or IPP Everywhere, which means they don't need to be installed to work - the device is found by Avahi and the print capabilities are communicated via IPP protocol - they are basically driverless devices. There are two solutions in Fedora which implement IPP everywhere:
 +
 +
* CUPS 'everywhere' model
 +
* cups-filters 'driverless' driver
 +
 +
===== CUPS 'everywhere' model =====
 +
 +
It is CUPS implementation of IPP everywhere standard, available as a special printer model. The model is used when you use CUPS temporary queue for your device or if you install your device with as IPP Everywhere model in CUPS web ui or via lpadmin (using '''-m everywhere''').
 +
 +
Because the created PPD file depends on IPP communication with printer, we need info which is gathered from the device. You can use '''ipptool''' for that:
 +
 +
<pre>
 +
$ ipptool -tv <your_printer_device_uri> get-printer-attributes.test &> ipptool_log
 +
</pre>
 +
 +
Attach the created {{filename|ipptool_log}} to the bugzilla ticket if needed.
 +
 +
===== cups-filters 'driverless' driver =====
 +
 +
Cups-filters special driver which is used for generating PPD according IPP Everywhere standard. The driver is used if you choose '''driverless''' model during printer installation.
 +
 +
We need get-printer-attributes request output too:
 +
 +
<pre>
 +
$ ipptool -tv <your_printer_device_uri> get-printer-attributes.test &> ipptool_log
 +
</pre>
 +
 +
and debug logs from the driver itself when it generates PPD for your device:
 +
 +
<pre>
 +
$ driverless -d cat <ipp_device_uri> 2> driverless_debug > created_ppd
 +
</pre>
 +
 +
Attach all created files to the bugzilla ticket if needed.
  
 
=== Finding where the problem lies ===
 
=== Finding where the problem lies ===
Line 141: Line 289:
 
</pre>
 
</pre>
  
Submitted job documents will remain in /var/spool/cups.
+
Submitted job documents will remain in /var/spool/cups. There are files with two types of names - dXXXXX-YYY and cXXXXX. dXXXXX-YYY is file which goes to CUPS system, unfiltered file - XXXXX is job ID, which is filled with zeros to be 5 characters long, and YYY is sequence number of file in the job. cXXXXX is file which contains printing options for a job specified by job ID in XXXXX. Please attach dXXXXX-YYY to the bug for a job when you experience the issue
  
 
===== Running filters by hand =====
 
===== Running filters by hand =====
Line 222: Line 370:
 
* 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.
 +
 +
== User stories ==
 +
 +
There are several common user stories when it comes to debugging printing issues. I'll mention some of them with steps how to get necessary information.
 +
 +
=== I have HP printer and have a problem with HPLIP script ===
 +
 +
Please follow the steps in the following sections:
 +
 +
* [[#Enable CUPS debug logging|enable CUPS debug logging]]
 +
* [[#How to start to capture incident-bound journal logging|start to capture journal logs]]
 +
* [[#HPLIP scripts debug logging|run the script with enabled debugging]]
 +
* [[#How to get incident-bound journal logging|get the journal logs]]
 +
* attach the files to the bugzilla ticket and [[#Turning off debug logging|turn off debug logging]]
 +
* provide printer model name and printer PPD file from '''/etc/cups/ppd/'''
 +
 +
=== I have HP printer, installed it with HPLIP and have a problem with it ===
 +
 +
HPLIP installed print queue has a device uri starting with '''hp://'''.
 +
 +
Please follow the steps in the following sections:
 +
 +
* [[#Enable CUPS debug logging|enable CUPS debug logging]]
 +
* [[#How to start to capture incident-bound journal logging|start to capture journal logs]]
 +
* trigger your issue
 +
* [[#How to get incident-bound journal logging|get the journal logs]]
 +
* attach the requested files to the bugzilla ticket and [[#Turning off debug logging|turn off debug logging]]
 +
* provide printer model name and printer PPD file from '''/etc/cups/ppd/'''
 +
 +
=== My printer doesn't print correctly or at all, but I can see the printer in print dialog ===
 +
 +
Please follow the steps in the following sections:
 +
 +
* [[#Enable CUPS debug logging|enable CUPS debug logging]]
 +
* [[#Prepare CUPS for job logging|prepare CUPS for job logging]]
 +
* [[#Restarting cups service|restart CUPS service]]
 +
* trigger your issue - print the specific document to the specific print queue you have problem with
 +
* [[#Get a job log for a specific Job ID|get the job log for the job you have just triggered]]
 +
* attach the created files to the ticket and [[#Turning off debugging|turn off debugging]]
 +
* attach your printer PPD file from '''/etc/cups/ppd/''' if available
 +
* attach the file you wanted to print
 +
* tell what application you printed from
 +
* mention your [[#Which driver am I using?|printer model]]
 +
 +
=== CUPS generic issue ===
 +
 +
For generic issues - printer wasn't found, segfault - please follow the steps in the following sections ('''avahi-daemon''' must run):
 +
 +
* [[#Enable CUPS debug logging|enable CUPS debug logging]]
 +
* [[#How to start to capture incident-bound cupsd logging| start to capture logs]]
 +
* trigger the issue - e.g. try to find printers via '''sudo lpinfo -l -v''', do some action in web ui - depends on your problem
 +
* [[#How to get incident-bound cupsd logging|get the logs]]
 +
* attach created files to the ticket and [[#Turning off debugging|turn off debugging]]
 +
* put the output of [[#What make and model is my printer?|lpinfo]] into a file and attach it
 +
* put the output of [[#Which print queues are available for me?|both lpstat commands]] into a file and attach it
 +
 +
=== My printer doesn't print correctly - I use 'everywhere' model ===
 +
 +
Please follow the steps in the following sections:
 +
 +
* [[#CUPS 'everywhere' model|get data from get-printer-attributes request]]
 +
* [[#My printer doesn't print correctly or at all, but I can see the printer in print dialog|follow the steps with CUPS job log user story]]
 +
 +
=== I have a generic problem with cups-browsed ===
 +
 +
Please follow the steps in the following sections:
 +
 +
* [[#Enable CUPS debug logging|enable CUPS debug logging]]
 +
* [[#cups-browsed logging|enable cups-browsed logging]], but don't restart cups-browsed yet.
 +
* [[#How to start to capture incident-bound cupsd logging|start to capture cupsd logs]]
 +
* start cups-browsed via '''systemctl''' and start to capture its logs:
 +
 +
<pre>
 +
$ journalctl -u cups-browsed -f > cups_browsed_log
 +
</pre>
 +
 +
* trigger the issue or wait until cups-browsed triggers the issue itself
 +
* cancel cups-browsed and [[#How to get incident-bound cupsd logging|cupsd log]] captures
 +
* attach created files {{filename|cups_whole_log}} and {{filename|cups_browsed_log}} to the ticket and [[#Turning off debugging|turn off debugging]]
 +
 +
=== Printer found by cups-browsed doesn't print or print badly ===
 +
 +
The most difficult user story - we need to know how the print queue was created and how it behaves during printing. The print queue found by cups-browsed has a device uri starting with '''implicitclass://'''.
 +
 +
Please follow the steps:
 +
 +
* [[#cups-filters 'driverless' driver|get printer info from get-printer-attributes and PPD file]]
 +
* [[#Enable CUPS debug logging|enable CUPS debug logging]]
 +
* [[#cups-browsed logging|enable cups-browsed logging]], but don't restart cups-browsed yet.
 +
* [[#How to start to capture incident-bound cupsd logging|start to capture cupsd logs]]
 +
* start cups-browsed via '''systemctl''' and start to capture its logs:
 +
 +
<pre>
 +
$ journalctl -u cups-browsed -f > cups_browsed_queue_creation
 +
</pre>
 +
 +
* give cups-browsed some time to process found devices (depends on how many devices you have in the local network or how many print queues are stored in the location you set with '''BrowsePoll''' directive)
 +
* cancel cups-browsed and [[#How to get incident-bound cupsd logging|cupsd log]] captures - save the files as {{filename|cups_queue_creation}} and {{filename|cups_browsed_queue_creation}}
 +
 +
Now we need to capture the logs during printing:
 +
 +
* [[#Prepare CUPS for job logging|prepare CUPS for job logging]]
 +
* [[#Restarting cups service|restart CUPS service]]
 +
* start to capture cups_browsed logs again:
 +
 +
<pre>
 +
$ journalctl -u cups-browsed -f > cups_browsed_printing
 +
</pre>
 +
 +
* trigger your issue - print the specific document to the specific print queue you have problem with
 +
* [[#Get a job log for a specific Job ID|get the job log for the job you have just triggered]] and cancel the capture of cups-browsed logging
 +
* attach all gathered log files
  
 
== Filing a bug report ==
 
== Filing a bug report ==
Line 238: Line 498:
  
 
For bugs only seen when using the '''hp''' backend, or the hpijs or hpcups drivers, select [https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=hplip hplip] for the component.
 
For bugs only seen when using the '''hp''' backend, or the hpijs or hpcups drivers, select [https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=hplip hplip] for the component.
 +
 +
For bugs for cups-browsed daemon and its printer discovery, please select  [https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=cups-filters cups-filters]
  
 
Other possibilities, depending on the problem, include:
 
Other possibilities, depending on the problem, include:
Line 250: Line 512:
 
=== Other information to include ===
 
=== 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|printing troubleshooter]], but you may also need to include other information such as:
+
Be prepared to include some information about your system as well.  Some of this can be gathered automatically using the [[#Printing_troubleshooter|printing troubleshooter]], but you may also need to include other information.
  
 +
====Before gathering of information====
 +
* Please change your OS locale to English. Manual [https://docs-old.fedoraproject.org/en-US/Fedora/26/html/System_Administrators_Guide/ch-System_Locale_and_Keyboard_Configuration.html].
 +
* Please attach gathered information as archive (example is [[#How to compress files|here]], you may need root permissions) to the bugzilla issue.
 +
* Please do not forget to trigger your issue after debug enabling and restarting cups and before information gathering.
 +
 +
====Information to gather====
 
* 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 the document is large, please try to see if the problem also occurs with a smaller document
 +
* cupsd journal logs when debug level 2 is turned on. How-to for turning debug2 on and for getting logs from systemd-journald is [[#How to get and attach logs for bug report|above]].
 +
* if the issue is connected to a print job, attach journal logs for this specific job too. How-to get logs [[#Getting debug information by other means|here]], example with JID. You can find out JID value by command:
 +
<pre>
 +
$ lpstat -W all
 +
</pre>
 +
.  Find your job there and JID is a number after '-'.
 +
* If the issue is about f.e. 'printing from evince prints garbage, but printing from libreoffice works', then attach two separate files - first will contain logs when you print from evince, latter logs when you print from libreoffice.
 +
* {{filename|troubleshoot.txt}} from system-config-printer (BEWARE: it doesn't contain journal logs - don't forget to attach them too).
 +
* [[#What make and model is my printer?|make and model]] of printer
 +
* config files - /etc/cups/client.conf (if it contains any changes from default), /etc/cups/cupsd.conf
 +
* if the issue is with cups-browsed and printer's discovery, attach /etc/cups/cups-browsed.conf and cups-browsed logs gained by how-to [[#cups-browsed logging|above]].
  
 
Some example documents can be found in [[:Category:Printing_Test_Cases|the Printing Test Cases category]].
 
Some example documents can be found in [[:Category:Printing_Test_Cases|the Printing Test Cases category]].
Line 261: Line 540:
 
The [[Printing|main printing page]] has more information about how printing works in Fedora.
 
The [[Printing|main printing page]] has more information about how printing works in Fedora.
  
 +
==Known issues==
 +
 +
Here are several known issues, which arise with certain circumstances, and there isn't general solution or upstream didn't want to add the solution to its project:
 +
 +
===cups-browsed===
 +
 +
====Cannot print due 'No destination hostname provided by cups-browsed, is it running?'====
 +
cups-browsed sometimes loses connection to print server (usually with old ones, like cups-1.4.2) when laptop changes network connection (change of WiFi network or after hibernate/suspend). You can make printing working again with cancelling your jobs and restarting cups-browsed by
 +
 +
<pre>
 +
$ cancel -a
 +
$ sudo systemctl restart cups-browsed
 +
</pre>
 +
 +
====cups-browsed consumes large amount of CPU====
 +
Creating local printer queues  takes long time for some printers with larger PPD file, so timeout of http connection will time out and it creates infinite loop of creating local printer queues. To solve this issue, please add
 +
 +
<pre>
 +
HttpLocalTimeout N
 +
HttpRemoteTimeout N
 +
</pre>
 +
 +
into /etc/cups/cups-browsed.conf, where 'N' is number of seconds after which connection is timed out. Then restart cups-browsed service. This option is currently in Fedora 27 and above.
 +
 +
====[SINCE FEDORA 27] cups-browsed creates different printer queue names than before====
 +
This issue is connected to remote cups queues, which are advertised  by older CUPS version (usually below cups-1.5, e.g. RHEL 6). Cups-browsed creates local print queues named by printer's DNS-SD ID by default and naming by remote cups queue is enabled again by adding:
 +
 +
<pre>
 +
LocalQueueNamingRemoteCUPS RemoteName
 +
</pre>
 +
 +
into /etc/cups/cups-browsed.conf and restart cups-browsed service.
 +
 +
===cups-filters===
 +
 +
====Printing takes a long time or doesn't print at all====
 +
When your printer needs a lot of time to do printing (from your POV) or doesn't print at all (some Xerox printers have such problems with gs renderer, so they are working again only with pdftops renderer), you can try to change the default postscript renderer. The default renderer in Fedora for most printers is gs filter from Ghostscript, but we have pdftops filter from Poppler for Brother, Minolta and Konica Minolta printers - this setup is called hybrid.
 +
 +
Other available renderer setups are gs (from Ghostscript), pdftops and pdftocairo (from Poppler), mupdf (from mupdf) and acroread (from adobe reader, not in Fedora official repositories), then you can set different default renderer for your print queue like this:
 +
 +
<pre>
 +
# lpadmin -p <printer-name> -o pdftops-renderer-default=gs/pdftops/pdftocairo/mudpf/acroread/hybrid
 +
</pre>
 +
 +
BEWARE: Most 'slow' printing issues are caused by PDF creating applications, which generates bad PDF file - and that bad generated PDF file is mostly the core of problem. To sum it up, slow printing issue can rise again with different PDF file, then it is on user's decision: if he wants to print fast and probably sometimes change the default renderer, or slow printing is not such critical issue.
 +
 +
===CUPS===
 +
 +
====CUPS doesn't take nicely some kinds of FQDN====
 +
CUPS sometimes has problems with some kinds of FQDN - that means when you use FQDN in 'BrowsePoll' directive in /etc/cups/cups-browsed.conf, CUPS doesn't recognize it as valid hostname - it is solved by adding:
 +
 +
<pre>
 +
ServerAlias your.own.fully.qualified.hostname.com
 +
</pre>
 +
 +
into /etc/cups/client.conf and restarting cups service.
 +
 +
===HPLIP===
 +
 +
First I would like to mention that we are not responsible for support HPLIP, which is downloaded and installed from HP website. Please install hplip rpms from official Fedora repositories at most cases.
 +
 +
====Hp-plugin: file does not match its checksum. File may have been corrupted or altered====
 +
This common error is mostly caused by external causes (server outage, network outage), when wget tries to download plugin, but it returns only error message. It is connected with message:
 +
 +
<pre>
 +
Plugin download failed with error code = N
 +
</pre>
 +
 +
where N is return value of wget (man wget), which is used for downloading proprietary plugin. Solutions for this issue may vary - you can wait until servers go up again or try to install plugin, which you download manually from  http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/ (select "Select and install an existing local copy of the plug-in file" during hp-setup or hp-plugin).
 +
 +
====Unable to load cupsext====
 +
This error can occur when hplip is installed from HP website, or its dependencies are mixed python2 and python3 packages or installed by pip. This is solved by removing all hplip packages (hplip, hplip-gui, hplip-libs, hplip-common, libsane-hpiao) and installing them again all from repositories.
 +
 +
====Missing hplip-gui====
 +
GUI tools and GUI parts of HP commands are moved to hplip-gui subpackage, because the main package can work without GUI, so the main package is smaller. The outcome of this decision is HP commands need to be run with '-i' option for interactive mode, or hplip-gui subpackage needs to be installed.
 +
 +
Tools, which need to be run with '-i' option for CLI or need to have hplip-gui installed for GUI:
 +
<pre>
 +
hp-align
 +
hp-clean
 +
hp-colorcal
 +
hp-diagnose_queues
 +
hp-fab
 +
hp-firmware
 +
hp-info
 +
hp-plugin
 +
hp-sendfax
 +
hp-setup
 +
hp-testpage
 +
hp-unload
 +
</pre>
 +
 +
Tools, which are in hplip-gui:
 +
<pre>
 +
hp-check
 +
hp-print
 +
hp-systray
 +
hp-toolbox
 +
hp-devicesettings
 +
hp-faxsetup
 +
hp-linefeedcal
 +
hp-makecopies
 +
hp-printsettings
 +
hp-wificonfig
 +
</pre>
 +
 +
====HP printer isn't discovered, doesn't print or doesn't print well====
 +
Some HP printers don't work well with URIs provided by CUPS (dnssd, usb, ipp) or they need proprietary plugin from HP, which cannot be in Fedora because of licensing issues. For such printers please try to run:
 +
 +
<pre>
 +
hp-setup -i -g
 +
</pre>
 +
for interactive mode, or:
 +
<pre>
 +
hp-setup -g
 +
</pre>
 +
 +
for graphic mode. This command installs HP printers and HP scanners. If you have issue about HP printer/HP scanner, which isn't discovered, doesn't print or doesn't print well, please try to install it by 'hp-setup', if it helps. If it doesn't help, please file a bugzilla, attach output of hp-setup and mention that you tried 'hp-setup'.
 +
 +
====Device which needs plugin does not work after HPLIP update====
 +
Devices which need plugin can stop to work after update to newer HPLIP version - it is due the check for plugin version in the code. The check is necessary to prevent inconsitencies when new features in open sourced HPLIP need new proprietary libraries from plugin. To make your printer work again, just download and install plugin again with:
 +
 +
<pre>
 +
$ hp-plugin -i
 +
</pre>
 +
 +
==Useful commands==
 +
===How to compress files===
 +
Example:
 +
<pre>
 +
$ tar -czvf cups-information.tar.gz /etc/cups cups.logs troubleshoot.txt lpinfo.log
 +
</pre>
 +
 +
=== Restarting cups service ===
 +
 +
You restart cups service with:
 +
 +
<pre>
 +
su -c 'systemctl restart cups.service'
 +
</pre>
 
[[Category:Debugging|P]] [[Category:How to]]
 
[[Category:Debugging|P]] [[Category:How to]]

Latest revision as of 06:14, 20 October 2020

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.

Contents

Identifying your problem area

Printing issues can be fairly complex and active cooperation or lots of data can be requested from reporter by maintainer to helping maintainer to at least understand and (if it is not hardware specific issue) reproduce the issue, so please have a patience and try to narrow the problem as much you are able to for maintainers.

There can be:

  • issues with seeing or connecting to the printer (it can be cups backend issues, avahi issues, libusb issues, cups-browsed issues),
  • accessibility issues (correct/wrong setup in cupsd.conf or its bad interpretation by cupsd daemon, bad cooperation with NIS, SSSD...),
  • printing with help of samba (issues with smb backend, which is part of samba) or with samba authenticated through Kerberos (samba_krb5_printing),
  • issues with filters used during filtering the document into document format supported by printer, which influence how or if the document will be printed (issue with filters - pdftops, pdftopdf, pstops, bannertopdf etc. - or issues with binaries or libraries which filters uses - libgs, qpdf, poppler...),
  • issues with Postscript Printer Description files, which are old way of defining printers capabilities like supported page sizes, borders etc...

Not mentioning possible limitations or issues in firmware or hardware of printer itself, so any kind of data or narrowing the issue is welcomed.

The best start is to attach files with logs described further down.

CUPS logging

All CUPS logging is redirected to journal by default since Fedora 28 (there was a redirecting of error_log to journal by default before Fedora 28, since Fedora 20). Printing troubleshooter doesn't have a feature to get logs from systemd journal yet, so CUPS logs need to be acquired by following steps.

We need to define two different ways of capturing incident-bound CUPS whole logs - the one if the broken print queue isn't provided by HPLIP and the other if it is. They differs in the filter option of journald - if you use non-HPLIP queue for debugging, it is okay to gather the logs from cups systemd unit (by '-u cups'), because all error messages are correctly redirected to cups systemd unit logging and they are accessible in the output after unit filtering. HPLIP libraries are not implemented to do the same (upstream is unresponsive to accept a potencial fix into the project and the issue is not critical enough to drag a downstream patch forever), so their messages aren't marked for cups systemd unit and they're filtered out after calling journald with '-u cups'. For such queues journald log without filtering is required.

Note:

Incident-bound journald log without filtering is required only for HPLIP print queues (their device uri starts with hp://) and it is unwanted for other queues, because it can be hard to read in larger cases. Please attach incident-bound journald log only when it is necessary.

Location of CUPS logging

CUPS logging is located in the system journal by default, but the logging into a file can be set in /etc/cups/cups-files.conf with directive 'ErrorLog'. If you want to change the default settings, then the name of the logging file is irrelevant, but it is recommended to put the file into path '/var/log/cups', otherwise SELinux will block cupsd from accessing it.

Setting the logging to a file has following cons (without further operations):

  • unable to get only logs connected to a job without chaining more commands
  • unable to get logs for specified time frame without chaining more commands

For capturing a incident-bound logs 'tail -f' can be used e.g.:

tail -f /var/log/cups/error_log

Enable CUPS debug logging

Enable full debugging information with:

su -c 'cupsctl --debug-logging'

CUPS job log

IMPORTANT If the problem appears when you sent document to print or if you are trying to, capture logs for this job. If the job log is available, its attaching is REQUIRED.

Prepare CUPS for job logging

For being able to see specific job log, please turn on:

PreserveJobFiles Yes

in your /etc/cups/cupsd.conf file and restart cup service. Do not forget to remove the line after you are done with debugging. 'lpstat -W all' seems to be empty after printing if you do not enable the directive.

Get a job log for a specific Job ID

To capture job log you need to know Job ID (JID) of the job - it is a number which together with print queue name specifies the job as request ID - for getting logs specific for the job.

Job ID can be seen in terminal if you send a document to print by lp command:

$ lp -d <print_queue_name> <file1> ... <fileN>
request id is <print_queue_name>-<JID> (N file(s))

Or when you list jobs (see man lpstat) - the latest job is at the end:

$ lpstat -W all
...
<print_queue_name>-<JID>           <user>           1024   Wed 11 Jan 2017 05:52:19 PM CET

You can get the latest job logs automatically (if you have awk installed and lpstat -W all returns jobs) by:

$ journalctl -u cups JID=`lpstat -W all | awk '{print $1}' | awk -F '-' '{print $NF}' | tail -n 1`

Or manually, if you found JID by yourself:

journalctl -u cups JID=<JID> > cups_job_log


Incident-bound cupsd log (broken print queue isn't HPLIP supported)

Sometimes we cannot bind the error with a specific print job, so the job log is uneffective. Incident-bound cupsd log is needed.

How to start to capture incident-bound cupsd logging

In new terminal/terminal tab, please issue:

journalctl -f -u cups > cups_whole_log
How to get incident-bound cupsd logging

After you trigger the error condition you are trying to diagnose e.g. printing something, try to find a printer via lpinfo etc., you terminate capturing incident-bound cupsd log from step above by ctrl+c.


Incident-bound cupsd log (broken print queue is HPLIP supported)

Unfortunately, HPLIP libraries don't log into CUPS unit in journal, so if your print queue is installed with HPLIP driver (its device uri starts with hp://), we need incident-bound journal log.

How to start to capture incident-bound journal logging

In new terminal/terminal tab, please issue:

journalctl -f > journal_whole_log
How to get incident-bound journal logging

After you trigger the error condition you are trying to diagnose e.g. printing something, running HP script etc., you terminate capturing incident-bound journal log from step above by ctrl+c.

Turning off debug logging

Please attach cups_job_log for the problematic job, cups_whole_log or journal_log if you caught whole cupsd log during the problematic event to bug report as an attachment.

Then to turn off debugging information, do this:

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

More commands for working with systemd-journald

View the log messages with:

journalctl -u cups -e

or:

journalctl -u cups --since=...

To filter out messages relating to a specific job ID, use:

journalctl -u cups JID=...

(tab completion will show you which job IDs have log messages)

cups-browsed logging

cups-browsed daemon was introduced in Fedora around cups-1.5 version. It can browse Bonjour broadcasts, CUPS broadcasts (deprecated) and LDAP servers for printers and create or remove local queues pointing to those printers. It can creates broadcasts of local CUPS queues, but it is marked as deprecated.

For setting debug logging on you need to add:

DebugLogging stderr

to /etc/cups/cups-browsed.conf.

The logs will be available in system journal after cups-browsed restart.

HPLIP scripts debug logging

Python scripts from HPLIP (e.g. hp-setup, hp-clean, hp-scan) have debug logging redirected to the standard error file descriptor, so they are not logged in journal. For getting their debug logging, run the script with -ldebug parameter e.g.:

$ hp-setup -ldebug -i

and reproduce the issue. Then copy the messages from terminal into hp_script_log. Please attach the file to the bugzilla ticket too.

What make and model is my printer?

Each different printer has a model-specific Device ID. You can find out 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 print queues are available for me?

The queues on your machine can be permanent ones or temporary. CUPS is capable to list all available print queues on the local network (permanent and temporary queues) by:

$ lpstat -e

For permanent queues you are able to get more info with:

$ lpstat -t

Which driver am I using?

The PPD file for the printer queue can tell you which driver is in use. 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.

Driverless models

Most printers released since 2010 are capable of AirPrint or IPP Everywhere, which means they don't need to be installed to work - the device is found by Avahi and the print capabilities are communicated via IPP protocol - they are basically driverless devices. There are two solutions in Fedora which implement IPP everywhere:

  • CUPS 'everywhere' model
  • cups-filters 'driverless' driver
CUPS 'everywhere' model

It is CUPS implementation of IPP everywhere standard, available as a special printer model. The model is used when you use CUPS temporary queue for your device or if you install your device with as IPP Everywhere model in CUPS web ui or via lpadmin (using -m everywhere).

Because the created PPD file depends on IPP communication with printer, we need info which is gathered from the device. You can use ipptool for that:

$ ipptool -tv <your_printer_device_uri> get-printer-attributes.test &> ipptool_log

Attach the created ipptool_log to the bugzilla ticket if needed.

cups-filters 'driverless' driver

Cups-filters special driver which is used for generating PPD according IPP Everywhere standard. The driver is used if you choose driverless model during printer installation.

We need get-printer-attributes request output too:

$ ipptool -tv <your_printer_device_uri> get-printer-attributes.test &> ipptool_log

and debug logs from the driver itself when it generates PPD for your device:

$ driverless -d cat <ipp_device_uri> 2> driverless_debug > created_ppd

Attach all created files to the bugzilla ticket if needed.

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.

To inspect the document that was submitted to CUPS for printing, enable the PreserveJobFiles option like this:

cupsctl PreserveJobFiles=yes

Submitted job documents will remain in /var/spool/cups. There are files with two types of names - dXXXXX-YYY and cXXXXX. dXXXXX-YYY is file which goes to CUPS system, unfiltered file - XXXXX is job ID, which is filled with zeros to be 5 characters long, and YYY is sequence number of file in the job. cXXXXX is file which contains printing options for a job specified by job ID in XXXXX. Please attach dXXXXX-YYY to the bug for a job when you experience the issue

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:

First you need to know the filter pipeline for application/vnd.cups-banner --> printer/pqueue (output MIME type). You can either enable debugging, print a test page, look into /var/log/cups/error_log and you'll find something similar to:

envp[29]="FINAL_CONTENT_TYPE=printer/pqueue"
Started filter /usr/lib/cups/filter/bannertopdf (PID 1111)
Started filter /usr/lib/cups/filter/pdftopdf (PID 1112)
Started filter /usr/lib/cups/filter/gstoraster (PID 1113)
Started filter /usr/lib/cups/filter/rastertogutenprint.5.2 (PID 1114)

or run

/usr/lib/cups/filter/bannertopdf 1 me '' 1 '' </usr/share/cups/data/testprint >bannertopdf.pdf
cupsfilter -e -m printer/pqueue -p /etc/cups/ppd/pqueue.ppd bannertopdf.pdf > /dev/null

and you'll see:

INFO: pdftopdf (PID 1111) started.
INFO: gstoraster (PID 1112) started.
INFO: rastertogutenprint.5.2 (PID 1113) started.
Note.png
note:
This filter pipeline is from cups-1.6. With cups < 1.6 you can see bannertops -> pstops -> pstoraster instead.

Now you can run filters by hand:

export PPD=/etc/cups/ppd/pqueue.ppd
/usr/lib/cups/filter/bannertopdf 1 me '' 1 '' </usr/share/cups/data/testprint >bannertopdf.pdf
/usr/lib/cups/filter/pdftopdf 1 me '' 1 '' <bannertopdf.pdf >pdftopdf.pdf
/usr/lib/cups/filter/pdftoraster 1 me '' 1 ''<pdftopdf.pdf >out.ras
/usr/lib/cups/filter/rastertogutenprint.5.2 1 me '' 1 ''<out.ras >out.prn

Here, evince or okular 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 (lpr -oraw out.prn) 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.

User stories

There are several common user stories when it comes to debugging printing issues. I'll mention some of them with steps how to get necessary information.

I have HP printer and have a problem with HPLIP script

Please follow the steps in the following sections:

I have HP printer, installed it with HPLIP and have a problem with it

HPLIP installed print queue has a device uri starting with hp://.

Please follow the steps in the following sections:

My printer doesn't print correctly or at all, but I can see the printer in print dialog

Please follow the steps in the following sections:

CUPS generic issue

For generic issues - printer wasn't found, segfault - please follow the steps in the following sections (avahi-daemon must run):

My printer doesn't print correctly - I use 'everywhere' model

Please follow the steps in the following sections:

I have a generic problem with cups-browsed

Please follow the steps in the following sections:

$ journalctl -u cups-browsed -f > cups_browsed_log
  • trigger the issue or wait until cups-browsed triggers the issue itself
  • cancel cups-browsed and cupsd log captures
  • attach created files cups_whole_log and cups_browsed_log to the ticket and turn off debugging

Printer found by cups-browsed doesn't print or print badly

The most difficult user story - we need to know how the print queue was created and how it behaves during printing. The print queue found by cups-browsed has a device uri starting with implicitclass://.

Please follow the steps:

$ journalctl -u cups-browsed -f > cups_browsed_queue_creation
  • give cups-browsed some time to process found devices (depends on how many devices you have in the local network or how many print queues are stored in the location you set with BrowsePoll directive)
  • cancel cups-browsed and cupsd log captures - save the files as cups_queue_creation and cups_browsed_queue_creation

Now we need to capture the logs during printing:

$ journalctl -u cups-browsed -f > cups_browsed_printing

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.

For bugs for cups-browsed daemon and its printer discovery, please select cups-filters

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.

Before gathering of information

  • Please change your OS locale to English. Manual [1].
  • Please attach gathered information as archive (example is here, you may need root permissions) to the bugzilla issue.
  • Please do not forget to trigger your issue after debug enabling and restarting cups and before information gathering.

Information to gather

  • the PPD file for the print queue (from the /etc/cups/ppd directory)
  • the document you are attempting to print -- if the document is large, please try to see if the problem also occurs with a smaller document
  • cupsd journal logs when debug level 2 is turned on. How-to for turning debug2 on and for getting logs from systemd-journald is above.
  • if the issue is connected to a print job, attach journal logs for this specific job too. How-to get logs here, example with JID. You can find out JID value by command:
$ lpstat -W all

. Find your job there and JID is a number after '-'.

  • If the issue is about f.e. 'printing from evince prints garbage, but printing from libreoffice works', then attach two separate files - first will contain logs when you print from evince, latter logs when you print from libreoffice.
  • troubleshoot.txt from system-config-printer (BEWARE: it doesn't contain journal logs - don't forget to attach them too).
  • make and model of printer
  • config files - /etc/cups/client.conf (if it contains any changes from default), /etc/cups/cupsd.conf
  • if the issue is with cups-browsed and printer's discovery, attach /etc/cups/cups-browsed.conf and cups-browsed logs gained by how-to above.

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.

Known issues

Here are several known issues, which arise with certain circumstances, and there isn't general solution or upstream didn't want to add the solution to its project:

cups-browsed

Cannot print due 'No destination hostname provided by cups-browsed, is it running?'

cups-browsed sometimes loses connection to print server (usually with old ones, like cups-1.4.2) when laptop changes network connection (change of WiFi network or after hibernate/suspend). You can make printing working again with cancelling your jobs and restarting cups-browsed by

$ cancel -a
$ sudo systemctl restart cups-browsed

cups-browsed consumes large amount of CPU

Creating local printer queues takes long time for some printers with larger PPD file, so timeout of http connection will time out and it creates infinite loop of creating local printer queues. To solve this issue, please add

HttpLocalTimeout N
HttpRemoteTimeout N

into /etc/cups/cups-browsed.conf, where 'N' is number of seconds after which connection is timed out. Then restart cups-browsed service. This option is currently in Fedora 27 and above.

[SINCE FEDORA 27] cups-browsed creates different printer queue names than before

This issue is connected to remote cups queues, which are advertised by older CUPS version (usually below cups-1.5, e.g. RHEL 6). Cups-browsed creates local print queues named by printer's DNS-SD ID by default and naming by remote cups queue is enabled again by adding:

LocalQueueNamingRemoteCUPS RemoteName

into /etc/cups/cups-browsed.conf and restart cups-browsed service.

cups-filters

Printing takes a long time or doesn't print at all

When your printer needs a lot of time to do printing (from your POV) or doesn't print at all (some Xerox printers have such problems with gs renderer, so they are working again only with pdftops renderer), you can try to change the default postscript renderer. The default renderer in Fedora for most printers is gs filter from Ghostscript, but we have pdftops filter from Poppler for Brother, Minolta and Konica Minolta printers - this setup is called hybrid.

Other available renderer setups are gs (from Ghostscript), pdftops and pdftocairo (from Poppler), mupdf (from mupdf) and acroread (from adobe reader, not in Fedora official repositories), then you can set different default renderer for your print queue like this:

# lpadmin -p <printer-name> -o pdftops-renderer-default=gs/pdftops/pdftocairo/mudpf/acroread/hybrid

BEWARE: Most 'slow' printing issues are caused by PDF creating applications, which generates bad PDF file - and that bad generated PDF file is mostly the core of problem. To sum it up, slow printing issue can rise again with different PDF file, then it is on user's decision: if he wants to print fast and probably sometimes change the default renderer, or slow printing is not such critical issue.

CUPS

CUPS doesn't take nicely some kinds of FQDN

CUPS sometimes has problems with some kinds of FQDN - that means when you use FQDN in 'BrowsePoll' directive in /etc/cups/cups-browsed.conf, CUPS doesn't recognize it as valid hostname - it is solved by adding:

ServerAlias your.own.fully.qualified.hostname.com

into /etc/cups/client.conf and restarting cups service.

HPLIP

First I would like to mention that we are not responsible for support HPLIP, which is downloaded and installed from HP website. Please install hplip rpms from official Fedora repositories at most cases.

Hp-plugin: file does not match its checksum. File may have been corrupted or altered

This common error is mostly caused by external causes (server outage, network outage), when wget tries to download plugin, but it returns only error message. It is connected with message:

Plugin download failed with error code = N

where N is return value of wget (man wget), which is used for downloading proprietary plugin. Solutions for this issue may vary - you can wait until servers go up again or try to install plugin, which you download manually from http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/ (select "Select and install an existing local copy of the plug-in file" during hp-setup or hp-plugin).

Unable to load cupsext

This error can occur when hplip is installed from HP website, or its dependencies are mixed python2 and python3 packages or installed by pip. This is solved by removing all hplip packages (hplip, hplip-gui, hplip-libs, hplip-common, libsane-hpiao) and installing them again all from repositories.

Missing hplip-gui

GUI tools and GUI parts of HP commands are moved to hplip-gui subpackage, because the main package can work without GUI, so the main package is smaller. The outcome of this decision is HP commands need to be run with '-i' option for interactive mode, or hplip-gui subpackage needs to be installed.

Tools, which need to be run with '-i' option for CLI or need to have hplip-gui installed for GUI:

hp-align
hp-clean
hp-colorcal
hp-diagnose_queues
hp-fab
hp-firmware
hp-info
hp-plugin
hp-sendfax
hp-setup
hp-testpage
hp-unload

Tools, which are in hplip-gui:

hp-check
hp-print
hp-systray
hp-toolbox
hp-devicesettings
hp-faxsetup
hp-linefeedcal
hp-makecopies
hp-printsettings
hp-wificonfig

HP printer isn't discovered, doesn't print or doesn't print well

Some HP printers don't work well with URIs provided by CUPS (dnssd, usb, ipp) or they need proprietary plugin from HP, which cannot be in Fedora because of licensing issues. For such printers please try to run:

hp-setup -i -g

for interactive mode, or:

hp-setup -g

for graphic mode. This command installs HP printers and HP scanners. If you have issue about HP printer/HP scanner, which isn't discovered, doesn't print or doesn't print well, please try to install it by 'hp-setup', if it helps. If it doesn't help, please file a bugzilla, attach output of hp-setup and mention that you tried 'hp-setup'.

Device which needs plugin does not work after HPLIP update

Devices which need plugin can stop to work after update to newer HPLIP version - it is due the check for plugin version in the code. The check is necessary to prevent inconsitencies when new features in open sourced HPLIP need new proprietary libraries from plugin. To make your printer work again, just download and install plugin again with:

$ hp-plugin -i

Useful commands

How to compress files

Example:

$ tar -czvf cups-information.tar.gz /etc/cups cups.logs troubleshoot.txt lpinfo.log

Restarting cups service

You restart cups service with:

su -c 'systemctl restart cups.service'