Repository navigation
lp: Bad Request #5211
Description
Server: cups 1.3.7
Client: Kbuntu 17.04 / Fedora 27 (since cups-Version 2.2.4-2.3b1)
Work: Printing from firefox
Don't Work: Printing from LibreOffice, Okular or lp
~> lp -d lama /etc/hosts
lp: Bad Request
debug2-LogLevel
d [02/Jan/2018:13:46:14 +0100] cupsdDoSelect: Write on fd 10...
d [02/Jan/2018:13:46:14 +0100] cupsdDoSelect: polling 7 fds for 1 seconds...
d [02/Jan/2018:13:46:14 +0100] cupsdDoSelect: epoll() returned 1...
d [02/Jan/2018:13:46:14 +0100] cupsdDoSelect: Write on fd 10...
d [02/Jan/2018:13:46:14 +0100] cupsdWriteClient: 10 bytes < 0
d [02/Jan/2018:13:46:14 +0100] cupsdAddSelect: fd=10, read_cb=0x40f013, write_cb=(nil), data=0x59de20
d [02/Jan/2018:13:46:14 +0100] cupsdDoSelect: polling 7 fds for 1 seconds...
d [02/Jan/2018:13:46:14 +0100] cupsdDoSelect: epoll() returned 1...
d [02/Jan/2018:13:46:14 +0100] cupsdDoSelect: Read on fd 10...
d [02/Jan/2018:13:46:14 +0100] cupsdReadClient: 10, used=0, file=-1 state=0
D [02/Jan/2018:13:46:14 +0100] cupsdReadClient: 10 POST /printers/lama HTTP/1.1
d [02/Jan/2018:13:46:14 +0100] cupsdFindBest: uri = "/printers/lama"...
d [02/Jan/2018:13:46:14 +0100] cupsdFindBest: Location CUPS_INTERNAL_BROWSE_ACL Limit 0
d [02/Jan/2018:13:46:14 +0100] cupsdFindBest: Location /printers/name Limit 7f
d [02/Jan/2018:13:46:14 +0100] cupsdFindBest: Location /printers Limit 7f
d [02/Jan/2018:13:46:14 +0100] cupsdFindBest: Location /jobs Limit 7f
d [02/Jan/2018:13:46:14 +0100] cupsdFindBest: Location /classes/name Limit 7f
d [02/Jan/2018:13:46:14 +0100] cupsdFindBest: Location /classes Limit 7f
d [02/Jan/2018:13:46:14 +0100] cupsdFindBest: Location /admin/log Limit 7f
d [02/Jan/2018:13:46:14 +0100] cupsdFindBest: Location /admin/conf Limit 7f
d [02/Jan/2018:13:46:14 +0100] cupsdFindBest: Location /admin Limit 7f
d [02/Jan/2018:13:46:14 +0100] cupsdFindBest: Location / Limit 7f
d [02/Jan/2018:13:46:14 +0100] cupsdFindBest: best = /printers
d [02/Jan/2018:13:46:14 +0100] cupsdAuthorize: con->uri="/printers/lama", con->best=0x555100(/printers)
d [02/Jan/2018:13:46:14 +0100] cupsdAuthorize: Authorization=""
D [02/Jan/2018:13:46:14 +0100] cupsdAuthorize: No authentication data provided.
d [02/Jan/2018:13:46:14 +0100] cupsdIsAuthorized: con->uri="/printers/lama", con->best=0x555100(/printers)
d [02/Jan/2018:13:46:14 +0100] cupsdIsAuthorized: level=CUPSD_AUTH_ANON, type=None, satisfy=CUPSD_AUTH_SATISFY_ALL, num_names=0
d [02/Jan/2018:13:46:14 +0100] cupsdIsAuthorized: auth=CUPSD_AUTH_ALLOW...
d [02/Jan/2018:13:46:14 +0100] POST /printers/lama
d [02/Jan/2018:13:46:14 +0100] CONTENT_TYPE = application/ipp
d [02/Jan/2018:13:46:14 +0100] cupsdReadClient: 10 con->data_encoding=HTTP_ENCODE_LENGTH, con->data_remaining=347, con->file=-1
E [02/Jan/2018:13:46:14 +0100] cupsdReadClient: 10 IPP Read Error!
D [02/Jan/2018:13:46:14 +0100] cupsdSendError: 10 code=400 (Bad Request)
D [02/Jan/2018:13:46:14 +0100] cupsdCloseClient: 10
d [02/Jan/2018:13:46:14 +0100] cupsdRemoveSelect: fd=10
d [02/Jan/2018:13:46:14 +0100] cupsdDoSelect: polling 6 fds for 1 seconds...
d [02/Jan/2018:13:46:15 +0100] cupsdDoSelect: epoll() returned 0...
d [02/Jan/2018:13:46:15 +0100] select_timeout(0): 100 seconds to timeout a client connection
d [02/Jan/2018:13:46:15 +0100] cupsdDoSelect: polling 6 fds for 100 seconds...
Activity
jsmeix commentedon Jan 3, 2018
@swbil
CUPS >= 1.6 has major incompatible changes
compared to CUPS up to version 1.5.4
in particular when printing via network:
The IPP protocol default version increased from 1.1 to 2.0.
Older IPP servers like CUPS 1.3.x reject IPP 2.0 requests
with "Bad Request", see
#4231
By adding '/version=1.1' to ServerName in client.conf e.g.
ServerName older.server.example.com/version=1.1
or to the CUPS_SERVER environment variable value
or by adding it to the server name value of the '-h' option e.g.
lpstat -h older.server.example.com/version=1.1 -p
the older IPP protocol version for older servers must be
specified explicitly.
Cf. the section about"CUPS Version Upgrade" in
https://www.suse.com/releasenotes/x86_64/SUSE-SLES/12/
swbil commentedon Jan 3, 2018
@jsmeix: thanks for your Tip, but we already use IPP 1.1 all time. We can print from firefox under Kbuntu 17.04 / Fedora 27.
cat /etc/cups/client.conf
ServerName domainXX.com/version=1.1
lp command works with cups-client from
Ubuntu 16.10 cups-2.1.3
Debian 9.3 cups-2.2.1
Something must be changed (IPP?) from cups 2.2.1 to 2.2.4.
michaelrsweet commentedon Jan 8, 2018
@swbil Can you use Wireshark to capture the traffic between the client and server? Nothing changed between 2.2.1 and 2.2.4 that would cause that kind of issue...
swbil commentedon Jan 11, 2018
Dear @michaelrsweet, you and your Team did/do a great great Job in the last 20 years!! ThankYOU! Without you, we would have had to live with lpsched of SUN or Windows printserver ;-)
Thanks for the hint with wireshark! Kbuntu 17.10, Debian Testing, Fedora 28 make IPP Request (Create-Job) with !! IPP 2.0 !! only. That's why it does not work and we'got "lp: Bad Request"
Is it a cups or linux problem?
michaelrsweet commentedon Jan 11, 2018
Hmm, will investigate but the code that sets the default IPP version hasn't changed in a long long time...
michaelrsweet commentedon Jan 11, 2018
OK, I've confirmed that lp is ignoring the server version; investigating...
michaelrsweet commentedon Jan 11, 2018
OK, the issue appears to be that the cupsCreateJob API now redirects to cupsCreateDestJob, which uses the destination information which tells it to use IPP/2.0... And that is because the cupsCopyDestInfo assumes that the initial version is 2.0, not 1.1... :/
Fix coming up...
Printing to old CUPS servers has been fixed (Issue #5211)
michaelrsweet commentedon Jan 11, 2018
[master 6a3d63e] Printing to old CUPS servers has been fixed (Issue #5211)
swbil commentedon Jan 21, 2018
Dear @michaelrsweet, thanks for the fix, but the bug (IPP 2.0) moves now to Get-Printer-Attributes
and stop from there. We don't see IPP Request (Create-Job) any more.
Can you check it, pls?
swbil commentedon Jan 23, 2018
Dear @michaelrsweet,
it works if I make a quick and dirty change at line 716 in cups/dest-options.c from cups-2.3b2-source.tar.gz
swbil commentedon Jan 31, 2018
Hi @michaelrsweet, I can't reopen this issue. Can you reopen for me, please?
michaelrsweet commentedon Jan 31, 2018
That change won't work since 1.1 clients don't get collection attributes.
Reopening while I determine why the negotiated version number isn't being used.
michaelrsweet commentedon Feb 1, 2018
[master b969d5a] Fix additional IPP/1.1 issues with cupsCopyDestInfo (Issue #5211)
michaelrsweet commentedon Feb 1, 2018
[master 27551f0] One more fix for _cupsGetDestResource (Issue #5211)
Fix additional IPP/1.1 issues with cupsCopyDestInfo (Issue #5211)
One more fix for _cupsGetDestResource (Issue #5211)
Backport CUPS 2.3.x changes to 2.2.x (Issue #5255)