Bug 737230
Summary: | [socket activation] http://localhost:631 returns "Bad Request" | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Joachim Frieben <jfrieben> |
Component: | cups | Assignee: | Tim Waugh <twaugh> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 16 | CC: | alekcejk, joachim.backes, jpopelka, mishu, twaugh |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | cups-1.5.0-16.fc16 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-10-19 04:42:15 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Joachim Frieben
2011-09-10 07:28:29 UTC
The following entry is appended to /var/log/cups/error_log: E [10/Sep/2011:09:29:37 +0200] Request from "[v1.::127.0.0.1]" using invalid Host: field "localhost:631" That's odd, it works fine for me. Does this still happen for you today? (And has the machine been rebooted since you reported the bug?) That said, there do seem to be some oddities in the systemd socket activation support: running 'cupsctl --debug-logging', for instance, seems to kill the UNIX domain socket. :-( I've filed the other problems as bug #738709 and bug #738710. I'm running cups-1.5.0-9.fc16 and see this problem every time. I see 'Bad Request' when visiting http://localhost:631 and 'Forbidden' on http://127.0.0.1:631 but http://[::1]:631 works as expected. From error_log D systemd_checkin: Matched existing listener /var/run/cups/cups.sock with fd 3... D systemd_checkin: Adding new listener [v1.::+3561226240] with fd 4... E Unable to bind socket for address [v1.::1]:631 - Address already in use. E Unable to bind socket for address 127.0.0.1:631 - Address already in use. I Listening to /var/run/cups/cups.sock:631 on fd 3... I Listening to [v1.::+3561226240]:631 on fd 4... The work-around for me is to: systemctl stop cups.service systemctl stop cups.socket systemctl start cups.service I think http://127.0.0.1:631/ is expected to say "Forbidden" nowadays unless ServerAlias is used. The http://localhost:631/ address should work though -- and works for me with Fedora 16 and cups-1.5.0-10.fc16. What does error_log say is the reason for the error? The error_log snippet from comment #4 I see when restarting cups service. When accessing http://localhost:631 I see E Request from "[v1.::127.0.0.1]" using invalid Host: field "localhost:631" I'm also running cups-1.5.0-10.fc16 (with default cupsd.conf). Please try with cups-1.5.0-12.fc16. I've included a fix which may well address this (addrlen is now initialised before calling getsockaddr()). Hmm, seems fixed (however after couple rounds of stopping/starting of socket/service). Great ! No fix with cups-1.5.0-13.fc16.x86_64 (after yum update on Oct 05): getting "bad request on "localhost:631" (In reply to comment #9) > No fix with cups-1.5.0-13.fc16.x86_64 (after yum update on Oct 05): getting > "bad request on "localhost:631" /var/log/cups/error_log ----------------------- E [05/Oct/2011:08:28:34 +0200] Unable to bind socket for address [v1.::1]:631 - Address already in use. E [05/Oct/2011:08:28:34 +0200] Unable to bind socket for address 127.0.0.1:631 - Address already in use. E [05/Oct/2011:08:28:53 +0200] Request from "[v1.::127.0.0.1]" using invalid Host: field "localhost:631" E [05/Oct/2011:08:28:53 +0200] Request from "[v1.::127.0.0.1]" using invalid Host: field "localhost:631" E [05/Oct/2011:08:28:54 +0200] Request from "[v1.::127.0.0.1]" using invalid Host: field "localhost:631" E [05/Oct/2011:08:28:54 +0200] Request from "[v1.::127.0.0.1]" using invalid Host: field "localhost:631" E [05/Oct/2011:08:28:56 +0200] Request from "[v1.::127.0.0.1]" using invalid Host: field "localhost:631" E [05/Oct/2011:08:28:56 +0200] Request from "[v1.::127.0.0.1]" using invalid Host: field "localhost:631" E [05/Oct/2011:08:29:20 +0200] Request from "[v1.::127.0.0.1]" using invalid Host: field "localhost:631" Joachim: just to be sure, did you stop the cups.service and cups.socket services, before starting cups.socket and cups.service again? (Or reboot?) (In reply to comment #11) > Joachim: just to be sure, did you stop the cups.service and cups.socket > services, before starting cups.socket and cups.service again? (Or reboot?) I rebooted several times! Always the same result. rpm -q cups cups-1.5.0-13.fc16.x86_64 OK, I think I see what might be happening. But: what does this say?: python -c 'import socket;print socket.getaddrinfo("localhost", 631)' (In reply to comment #13) > OK, I think I see what might be happening. But: what does this say?: > > python -c 'import socket;print socket.getaddrinfo("localhost", 631)' python -c 'import socket;print socket.getaddrinfo("localhost", 631)' [(2, 1, 6, '', ('127.0.0.1', 631)), (2, 2, 17, '', ('127.0.0.1', 631)), (2, 3, 0, '', ('127.0.0.1', 631))] OK. So it's only resolving to IPv4 addresses. What does "ip addr show dev lo" say? ip addr show dev lo 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever Thanks. So there is an AF_INET6 loopback address for it. What's in /etc/hosts? # hostname eule added to /etc/hosts by anaconda 127.0.0.1 eule localhost.localdomain localhost ::1 eule localhost6.localdomain6 localhost6 192.168.100.1 router 131.246.137.16 lindb 131.246.137.2 lindc 131.246.119.65 linda 2001:638:208:ef44:0:ff:fe00:65 linda6 131.246.113.225 head1 131.246.137.121 aixd3 131.246.137.118 aixd4 131.246.113.242 smp1 #2002:5f59:ca04:0:219:66ff:fe38:46aa eule6 192.168.100.112 kaba-pc *** Bug 743585 has been marked as a duplicate of this bug. *** cups-1.5.0-14.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/FEDORA-2011-13168 Almost everything works with cups-1.5.0-14.fc16 - http://localhost:631, http://localhost.localdomain:631, http://127.0.0.1:631, http://[::1]:631 but for http://localhost6:631 and http://localhost6.localdomain6:631 opened "Bad Request - CUPS v1.5.0". cups-1.5.0-14.fc16 works for me. Thank you! (In reply to comment #21) > Almost everything works with cups-1.5.0-14.fc16 - http://localhost:631, > http://localhost.localdomain:631, http://127.0.0.1:631, http://[::1]:631 but > for http://localhost6:631 and http://localhost6.localdomain6:631 opened "Bad > Request - CUPS v1.5.0". That's the same as in Fedora 15 (cups 1.4.x) though. If you want to use localhost6 or localhost6.localdomain6 that way, you can add ServerAlias lines to /etc/cups/cupsd.conf. The default for Fedora is that "localhost" resolves to an IPv6 address (::1). Package cups-1.5.0-14.fc16: * should fix your issue, * was pushed to the Fedora 16 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing cups-1.5.0-14.fc16' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2011-13168 then log in and leave karma (feedback). Package cups-1.5.0-15.fc16: * should fix your issue, * was pushed to the Fedora 16 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing cups-1.5.0-15.fc16' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2011-13168 then log in and leave karma (feedback). The upstream approach is to use the IPV6_V6ONLY socket option, so we'll follow suit in the systemd support by using the BindIPv6Only keyword in the cups.socket unit file. Package cups-1.5.0-16.fc16: * should fix your issue, * was pushed to the Fedora 16 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing cups-1.5.0-16.fc16' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2011-13168 then log in and leave karma (feedback). cups-1.5.0-16.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report. |