FS#30975 - [cups] lpstat: Bad request. Printing will not work

Attached to Project: Arch Linux
Opened by roko (roko) - Thursday, 02 August 2012, 11:55 GMT
Last edited by Andreas Radke (AndyRTR) - Saturday, 04 August 2012, 08:55 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Andreas Radke (AndyRTR)
Architecture x86_64
Severity Critical
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
This is a regression. With the newest version of libcups (1.6.1-1) I cannot get a list of printers from the remote cups server. Running lpstat gives:

$ lpstat -a
lpstat: Bad Request

Everything works with libcups-1.5.3-5 and cups-1.5.3-5.

In the attachment the output of the strace lpstat -a (the case, in which I get Bad request).
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Saturday, 04 August 2012, 08:55 GMT
Reason for closing:  Won't fix
Comment by Andreas Radke (AndyRTR) - Friday, 03 August 2012, 18:31 GMT
Have you adopted the printer browsing related changes?
Comment by roko (roko) - Friday, 03 August 2012, 18:38 GMT
Sorry, what do you mean? I have my cups' server IP in /etc/cups/client.conf. Is this not enough?
Comment by roko (roko) - Friday, 03 August 2012, 18:41 GMT
Also Wiki says:

Note: This behavior has not been changed with cups 1.6.x - the difference is that until 1.5.x cupsd was able to do printer browsing alone and now needs avahi to discover unknown printers!

Maybe it should be: has been changed, not has NOT been changed?
Comment by Andreas Radke (AndyRTR) - Friday, 03 August 2012, 19:06 GMT
cat /etc/cups/client.conf
ServerName 192.168.1.90:631

That's what I have and lpstat shows up here all printers that my server allows to be browsable. The server may need some changes if it's also running Arch or some
other distro that also upgraded to cups 1.6.x.
Comment by roko (roko) - Friday, 03 August 2012, 20:00 GMT
I had only a hostname, but IP:631 hasn't change anything. On the server there is 1.2.7.

Using strace I was able to do the following findings:
a)with an older libcups, that works:
sendto(4, "POST / HTTP/1.1\r\nContent-Length: 349\r\nContent-Type: application/ipp\r\nHost: 134.34.57.71\r\nUser-Agent: CUPS/1.5.3\r\nExpect: 100-continue\r\n\r\n", 137, 0, NULL, 0) = 137
sendto(4, "\1\1\0\n\0\0\0\1\1G\0\22attributes-charset\0\5utf-8H\0\33attributes-natural-language\0\5en-usE\0\vprinter-uri\0\20ipp://localhost/D\0\24requested-attributes\0\6job-idD\0\0\0\fjob-k-octetsD\0\0\0\10job-nameD\0\0\0\31job-originating-user-nameD\0\0\0\31job-printer-state-messageD\0\0\0\17job-printer-uriD\0\0\0\21job-state-reasonsD\0\0\0\20time-at-creationB\0\24requesting-user-name\0\5romanD\0\nwhich-jobs\0\rnot-completed\3", 349, 0, NULL, 0) = 349
recvfrom(4, "HTTP/1.1 100 Continue\r\n\r\n", 2048, 0, NULL, NULL) = 25
recvfrom(4, "HTTP/1.1 200 OK\r\nDate: Fri, 03 Aug 2012 19:52:42 GMT\r\nServer: CUPS/1.2\r\nConnection: Keep-Alive\r\nKeep-Alive: timeout=60\r\nContent-Language: en\r\nContent-Type: application/ipp\r\nContent-Length: 75\r\n\r\n\1\1\0\0\0\0\0\1\1G\0\22attributes-charset\0\5utf-8H\0\33attributes-natural-language\0\5en-us\3", 2048, 0, NULL, NULL) = 270

b)with a newer libcups:
sendto(4, "POST / HTTP/1.1\r\nContent-Length: 349\r\nContent-Type: application/ipp\r\nHost: 134.34.57.71\r\nUser-Agent: CUPS/1.6.1\r\nExpect: 100-continue\r\n\r\n", 137, 0, NULL, 0) = 137
sendto(4, "\2\0\0\n\0\0\0\1\1G\0\22attributes-charset\0\5utf-8H\0\33attributes-natural-language\0\5en-usE\0\vprinter-uri\0\20ipp://localhost/D\0\24requested-attributes\0\6job-idD\0\0\0\fjob-k-octetsD\0\0\0\10job-nameD\0\0\0\31job-originating-user-nameD\0\0\0\31job-printer-state-messageD\0\0\0\17job-printer-uriD\0\0\0\21job-state-reasonsD\0\0\0\20time-at-creationB\0\24requesting-user-name\0\5romanD\0\nwhich-jobs\0\rnot-completed\3", 349, 0, NULL, 0) = 349
recvfrom(4, "HTTP/1.1 100 Continue\r\n\r\n", 2048, 0, NULL, NULL) = 25
recvfrom(4, "HTTP/1.1 400 Bad Request\r\nDate: Fri, 03 Aug 2012 19:48:59 GMT\r\nServer: CUPS/1.2\r\nContent-Language: en\r\nUpgrade: TLS/1.0,HTTP/1.1\r\nConnection: close\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: 344\r\n\r\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<HTML>\n<HEAD>\n\t<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n\t<TITLE>400 Bad Request</TITLE>\n\t<LINK REL=\"STYLESHEET\" TYPE=\"text/css\" HREF=\"/cups.css\">\n</HEAD>\n<BODY>\n<H1>400 Bad Request</H1>\n<P></P>\n</BODY>\n</HTML>\n", 2048, 0, NULL, NULL) = 556



The difference is only that at the beginning of the second sendto the old one is sending "\1\1\0" as first three hex numbers(?) and the new one "\2\0\0".

What are those numbers? Version of the communication format? Maybe it indicates that the server is too old?
Comment by roko (roko) - Friday, 03 August 2012, 20:19 GMT
From the cups CHANGELOG:
The default IPP version for requests is now 2.0 (STR #3929)

So the server is indeed too old. Bad for me, I do not have influence on it.
Comment by Andreas Radke (AndyRTR) - Saturday, 04 August 2012, 08:50 GMT
I guess we can't fix this issue. You may ask Micheal on the cups list if you can get them somehow to work together. No idea if your server supports mdns/dnssd browsing.
Comment by roko (roko) - Saturday, 04 August 2012, 08:53 GMT
I guess so too, so close the bug too.

Loading...