"uncaptured python exception"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| python2.7 (Ubuntu) |
Undecided
|
Unassigned | ||
| squid-deb-proxy (Ubuntu) |
Low
|
Unassigned | ||
Bug Description
I get the following error when running the discovery script on the command line.
$ /usr/share/
error: uncaptured python exception, closing channel <AptAvahiClient> ('10.1.2.3', 3142): 2147483647 (<class 'socket.
error: uncaptured python exception, closing channel <AptAvahiClient> ('10.0.3.1', 3142): 2147483647 (<class 'socket.
error: uncaptured python exception, closing channel <AptAvahiClient> ('172.24.74.129', 3142): 2147483647 (<class 'socket.
http://
The last line still returns the proper proxy URI so as far as I can tell things are still working. The IP 10.1.2.3 is for an n2n VPN. This is on trusty with version 0.8.6ubuntu1.
cell (jasonpepas) wrote : | #1 |
The attachment "Minimal patch to work-around this bug." seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.
[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]
tags: | added: patch |
cell (jasonpepas) wrote : | #3 |
(oops, the previous patch had some garbage at the top. re-attaching the patch here).
cell (jasonpepas) wrote : | #4 |
So, I went ahead and made a different version of the patch which sends asyncore's logging output to syslog, instead of stderr. This keep's apt-get's output clean.
I think this is the patch I'd prefer. However, I should probably also bark up the tree of asyncore.py and ask why they are calling 'print' on something labelled as an 'error' instead of just throwing an exception (which would allow apt-avahi-discover to deal with it appropriately).
(see attached patch).
Rolf Leggewie (r0lf) wrote : | #5 |
Thanks, Jason! I applied the patch locally and indeed it works beautifully.
I hope it lands soon and gets backported to trusty.
Rolf Leggewie (r0lf) wrote : | #6 |
@mvo, it would be nice if you took the time to consider inclusion of the patch from comment 4
Changed in squid-deb-proxy (Ubuntu): | |
status: | New → In Progress |
Rolf Leggewie (r0lf) wrote : | #7 |
Going by what's written here and in bug 1422162 it looks like this problem occurs whenever there is more than one host/IP discovered via avahi.
Changed in squid-deb-proxy (Ubuntu): | |
status: | In Progress → Confirmed |
Andreas Hasenack (ahasenack) wrote : | #8 |
I believe this is fixed in eoan at least:
root@eoan-
root@eoan-
http://
root@eoan-
Failed to resolve service 'Squid deb proxy on eoan-squid-
root@eoan-
apt update works just fine, but it spits out the error, as mentioned in comment #3:
root@eoan-
Failed to resolve service 'Squid deb proxy on eoan-squid-
Hit:1 http://
Hit:2 http://
Hit:3 http://
Hit:4 http://
Reading package lists... Done
Building dependency tree
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.
Same in xenial, so I'll assume the versions in between are also ok:root@
Failed to resolve service 'Squid deb proxy on eoan-squid-
http://
root@xenial-
http://
root@xenial-
root@xenial-
0% [Working]Failed to resolve service 'Squid deb proxy on eoan-squid-
Failed to resolve service 'Squid deb proxy on eoan-squid-
Hit:1 http://
Hit:2 http://
Hit:3 http://
Hit:4 http://
Hit:5 http://
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
root@xenial-
0
root@xenial-
Changed in squid-deb-proxy (Ubuntu): | |
status: | Confirmed → Fix Released |
Rolf Leggewie (r0lf) wrote : | #9 |
Andreas, I cannot confirm this for focal and I believe you should have asked for confirmation from others before closing.
Code inspection suggests nothing was done to fix this bug, but of course it was possible that a change in asyncore.py fixed this. That does not look to be the case. I tested the patch from #4 again, it works and I believe it should be applied in focal and bionic.
$ /usr/share/
error: uncaptured python exception, closing channel <AptAvahiClient> ('2003:
error: uncaptured python exception, closing channel <AptAvahiClient> ('2003:
error: uncaptured python exception, closing channel <AptAvahiClient> ('2003:
error: uncaptured python exception, closing channel <AptAvahiClient> ('2003:
error: uncaptured python exception, closing channel <AptAvahiClient> ('192.168.34.22', 3142): 9223372036854775807 (<class 'ConnectionRefu
error: uncaptured python exception, closing channel <AptAvahiClient> ('192.168.34.22', 3142): 9223372036854775807 (<class 'ConnectionRefu
http://
Changed in squid-deb-proxy (Ubuntu): | |
status: | Fix Released → Confirmed |
tags: | added: bionic |
tags: | added: focal |
Rolf Leggewie (r0lf) wrote : | #10 |
filing against python2.7 as well based on comment #4
Rolf Leggewie (r0lf) wrote : | #11 |
I've long been using the patch from this ticket successfully and have now published a bionic package in my LTS ppa https:/
I just ran into this bug, and I think I've figured it out.
/usr/share/ squid-deb- proxy-client/ apt-avahi- discover is outputting the URL of my squid-deb-proxy server, but it is also spitting out some errors:
root@debian:~# /usr/share/ squid-deb- proxy-client/ apt-avahi- discover error'> :[Errno 111] Connection refused [/usr/lib/ python2. 7/asyncore. py|read| 83] [/usr/lib/ python2. 7/asyncore. py|handle_ read_event| 446] [/usr/lib/ python2. 7/asyncore. py|handle_ connect_ event|454] ) error'> :[Errno 111] Connection refused [/usr/lib/ python2. 7/asyncore. py|read| 83] [/usr/lib/ python2. 7/asyncore. py|handle_ read_event| 446] [/usr/lib/ python2. 7/asyncore. py|handle_ connect_ event|454] ) 192.168. 2.232:8000/]
error: uncaptured python exception, closing channel <AptAvahiClient> ('192.168.2.232', 3142): 9223372036854775807 (<class 'socket.
error: uncaptured python exception, closing channel <AptAvahiClient> ('192.168.2.80', 3142): 9223372036854775807 (<class 'socket.
http://
The problem here is that the errors are going to stdout, not to stderr. This means apt's Acquire: :http:: ProxyAutoDetect is not able to figure out what the proxy URL is.
I have locally modified apt-avahi-discover so that the errors are sent to stderr, and I have verified that this allows apt's Acquire: :http:: ProxyAutoDetect to work correctly. I have attached this as a patch.
This patch is enough to fix this bug, but I'm not sure it's ultimately the best fix for the overall issue. I think ideally, in the case were apt-avahi-discover encounters non-fatal errors (and is still able to produce a working URL), these error should probably just get logged to syslog, rather than being sent to stderr, because it does make apt's console output look rather ugly, and the user doesn't need to see any of that, because if there's a working URL, ultimately they don't care any other errors.
(This is what apt's output looks like with the patch applied to apt-avahi- discover: )
0 upgraded, 826 newly installed, 0 to remove and 1 not upgraded. error'> :[Errno 111] Connection refused [/usr/lib/ python2. 7/asyncore. py|read| 83] [/usr/lib/ python2. 7/asyncore. py|handle_ read_event| 446] [/usr/lib/ python2. 7/asyncore. py|handle_ connect_ event|454] ) error'> :[Errno 111] Connection refused [/usr/lib/ python2. 7/asyncore. py|read| 83] [/usr/lib/ python2. 7/asyncore. py|handle_ read_event| 446] [/usr/lib/ python2. 7/asyncore. py|handle_ connect_ event|454] ) error'> :[Errno 111] Connection refused [/usr/lib/ python2. 7/asyncore. py|read| 83] [/usr/lib/ python2. 7/asyncore. py|handle_ read_event| 446] [/usr/lib/ python2. 7/asyncore. py|handle_ connect_ event|454] )
Need to get 500 MB of archives.
After this operation, 1,554 MB of additional disk space will be used.
Do you want to continue? [Y/n]
0% [Working]log: error: uncaptured python exception, closing channel <AptAvahiClient> ('192.168.2.80', 3142): 9223372036854775807 (<class 'socket.
log: error: uncaptured python exception, closing channel <AptAvahiClient> ('192.168.2.232', 3142): 9223372036854775807 (<class 'socket.
log: error: uncaptured python exception, closing channel <AptAvahiClient> ('192.168.2.80', 3142): 9223372036854775807 (<class 'socket.
log: error: uncaptured python exception, closing channel <AptAvahiClient> (...