Bug 1275879 - queueing a second job while first is printing takes printer offline.
queueing a second job while first is printing takes printer offline.
Product: Fedora
Classification: Fedora
Component: cups (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Zdenek Dohnal
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-10-27 23:20 EDT by Stephen Dum
Modified: 2016-12-20 10:11 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-12-20 10:11:40 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
output from journalctl _COMM=cupsd --since=2015-10-27 (1.80 MB, text/plain)
2015-10-28 21:57 EDT, Stephen Dum
no flags Details
output after sudo cupsctl LogLevel=debug2 (672.54 KB, text/plain)
2015-11-02 20:20 EST, Stephen Dum
no flags Details
Output from tcpdump -r lpd-pcap -X (776.30 KB, text/plain)
2015-11-07 23:01 EST, Stephen Dum
no flags Details

  None (edit)
Description Stephen Dum 2015-10-27 23:20:08 EDT
Description of problem:
printing to a Canon MP495 with wireless interface. If I queue (with lpr) another job while printer is still printing previous job the printer is taken offline.
Same behavior in f22 and f23 download on 10/27

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.lpr a job (jpg of a page scan, libreoffice file)
2.before it's finished, print another job, either with lpr, libreoffice, gimp,..
3.Printer is marked offline. Must be re-enabled to continue

Actual results:
printer disabled when second job queued, must be manually re-enabled with cupsenable.

Expected results:
job queued, printer remain online

Additional info:
Comment 1 Tim Waugh 2015-10-28 06:54:17 EDT
Could you please run 'journalctl _COMM=cupsd --since=2015-10-27' and attach the output? Thanks.
Comment 2 Stephen Dum 2015-10-28 21:57 EDT
Created attachment 1087344 [details]
output from journalctl _COMM=cupsd --since=2015-10-27

three events of interest - where printer was re-enabled at timestamps
18:05:24, 18.05:29 and 22:01:38
Comment 3 Tim Waugh 2015-11-02 05:18:16 EST
Job 23, started Oct 27 17:54:55, failed here:

Oct 27 17:55:00 drdoom cupsd[1200]: Rendering completed
Oct 27 17:55:00 drdoom cupsd[1200]: Connecting to printer.
Oct 27 17:55:00 drdoom cupsd[1200]: Connected to printer.
Oct 27 17:55:00 drdoom cupsd[1200]: Hint: Try setting the LogLevel to "debug" to find out more.
Oct 27 17:55:00 drdoom cupsd[1200]: Backend returned status 1 (failed)
Oct 27 17:55:00 drdoom cupsd[1200]: Printer stopped due to backend errors; please consult the error_log file for details.

The next INFO-level log line we would expect would be "Control file sent successfully." and so the three points at which it might have failed are:

fstat() on the input file [unlikely]
Sending the receive-print-job LPD command
Sending the receive-control-file LPD command

To find out which, please run 'cupsctl LogLevel=debug2' to enable extra debugging and see if you can cause the error to happen again.

Could it be that the printer is being used by more than one queue at a time, and is failing LPD requests rather than delaying connection attempts?
Comment 4 Stephen Dum 2015-11-02 20:20 EST
Created attachment 1088787 [details]
output after sudo cupsctl LogLevel=debug2

I ran cupsctl LogLevel=debug2
which resulted in
cupsctl |grep '^_debug_logging'

It looked like the queue didn't disable until the 1st job finished printing.
lpr file
didn't show printer as disabled. but when 1st job finished it was.

Also, There are two print queues on this machine, one restricting output to black,
the other normal.  THere was no overt acvtivity on the other queue.
There was no other network activity to the printer while testing.
Comment 5 Tim Waugh 2015-11-03 05:48:18 EST

Could you please try capturing the communication between the computer and the printer?

This will print the TCP header and 4 data bytes from each packet:

tcpdump -w lpd.pcap -U -s 70 host port 515

We only need to see the first few packets of a failed connection to know what's wrong. If you can set that tcpdump command running, and only stop it once a job fails, you can extra the packets we're interested in by running:

tcpdump -r lpd.pcap -X

and correlating the timestamps with the output of this:

journalctl -e MESSAGE='Backend returned status 1 (failed)'

Once you've found the packets, please add them into a comment here so I can figure out what's going on. The start of the connection will be indicated by '[S]' in the flags, and the final three packets of the connection will have flags [F.], [F.], and [.].

I'm expecting to see a packet sent to the printer where the last four bytes of the printed output are 0x2 followed by 'Bla' (the start of the name of the printer) -- that's the command to receive a job.

The printer should reply to that with either 0x0 (ok) or some other byte indicating error.

If it responded with 0x0, we should be sending a control file, so the next packet we send should have printed output that ends with 0x2 followed by numeric digits (the start of the length of the control file).

If we get this far, the printer will respond with some other byte that 0x0, as we know this step did not succeed.
Comment 6 Stephen Dum 2015-11-07 23:01 EST
Created attachment 1091166 [details]
Output from tcpdump -r lpd-pcap -X

Most of what you said I should see in the tcpdump doesn't agree with what I
I added the 'and' to the tcpdump command
tcpdump -w lpd.pcap -U -s 70 host and  port 515
tcpdump: listening on enp4s0, link-type EN10MB (Ethernet), capture size 70
C2390 packets captured
2390 packets received by filter
0 packets dropped by kernel

browsing to http: printer status page
    thinks its name is "Canon MP495 series" not Black-MP495
Output from journalctl -e MESSAGE='Backend returned status 1 (failed)'
Nov 07 16:13:53 drdoom cupsd[10645]: Backend returned status 1 (failed)

Only a few packets at 16:13:53, but since data didn't match what you described, 
I attached the whole dump (it was under 1 Mb)
Comment 7 Fedora Admin XMLRPC Client 2016-06-24 06:30:46 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 8 Fedora End Of Life 2016-11-24 07:56:54 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 9 Fedora End Of Life 2016-12-20 10:11:40 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.