CUPS prints files out of order
Environment
- Red Hat Enterprise Linux (RHEL)
- Common Unix Printing System (CUPS)
Issue
-
Out-of-sequence print output. Example: Order of the printing is job #2, then job #3, then comes a delay of about 10 minutes and then job #1 is printed. Then there's another delay lasting about 2 minutes and then job #4 is printed. Another delay of about 5 minutes and then job #5 is printed. Another 5 minute delay and then job #6, job #8, and job #9 are printed. Finally, another 7 minute delay and job #7 is printed.
-
Packing slip report sheets are printed not in order. I mean that the order of the printing was 413086 and 413087, then comes a delay about 10 minute, then printed the 413085 another delay about 2 minute then printed the 413988, another delay about 5 minute then printed the 413089 another five minute delay then printed the 413090, 413092, 413093 and another 7 minute delay and printed the 413091 sheet.
Resolution
-
Eliminate printing errors as described in the following Knowledgebase Solution:
Poor printing performance printing to LPD printers in Red Hat Enterprise Linux
-
Print multiple files on the same command line.
-
It may be possible to reduce out-of-order printing by adding or changing the following line in
/etc/cups/cupsd.conf:JobRetryInterval 0This will not stop the delays in printing, but it may fix out-of-order printing by configuring CUPS to immediately retry a failed print job instead of holding it for 30 seconds. Additional information on the CUPS
JobRetryIntervalcan be found in the following Knowledgebase Solution:
Root Cause
Jobs sent to the same print queue will be sent to the printer in the order in which they were accepted by CUPS. You can tell the order by the Job ID. When there are multiple print jobs in a print queue, the lowered-numbered job will always be printed first.
The only exception to this is wen files are submitted as separate print jobs, errors can cause the print jobs to be printed out of order. If the ErrorPolicy for a printer (defined in /etc/cups/printers.conf) is set to retry-job, then the job is re-queued to print at a later time. When CUPS sees a failure in a backend process, it holds the job for a period of time specified by the JobRetryInterval option in /etc/cups/cupsd.conf. By default, JobRetryInterval is set to 30 seconds. While the job is being held, other jobs can be printed on the same printer, leading to jobs being printed in a different order than they were added to the print queue.
However, when files are submitted as part of the same print job, all the files are treated as a single group. The lp and lpr commands submit multi-file print jobs to the local CUPS server as a single job with multiple files. The files will be printed in the same order as specified on the command line. If those files are relayed to a remote CUPS server, they will again be treated as a single, atomic, print job, and again, the order in which the files are printed will be the same as specified on the command line.
It is possible to configure two separate CUPS servers to send jobs to the same physical printer. If that printer accepts multiple connections (which some HP and Canon printers will do), then it is the responsibility of the printer to treat a single connection as a single job and not interleave multiple connections/jobs. Check with the printer manufacturer to see how the printer handles connections from multiple print servers.
Diagnostic Steps
Look for warnings like the following in /var/log/cups/error_log that indicate errors during printing:
W [23/Mar/2010:02:29:37 -0500] [Job 8104] Remote host did not respond with command status byte after 300 seconds!
I [23/Mar/2010:02:29:37 -0500] [Job 8104] Backend returned status 1 (failed)
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
