python-httplib2 crashes with AttributeError in __init__() if connection refused

Bug #523327 reported by C de-Avillez
50
This bug affects 7 people
Affects Status Importance Assigned to Milestone
httplib2
Unknown
Unknown
python-httplib2 (Ubuntu)
Fix Released
High
Unassigned
Lucid
Won't Fix
Undecided
Unassigned
Maverick
Invalid
High
Unassigned
Natty
Invalid
High
Unassigned

Bug Description

Binary package hint: bughugger

just ran it.

ProblemType: Crash
Architecture: amd64
Date: Wed Feb 17 11:55:25 2010
DistroRelease: Ubuntu 10.04
EcryptfsInUse: Yes
ExecutablePath: /usr/bin/bughugger
InterpreterPath: /usr/bin/python2.6
Package: bughugger 10.02.1
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/bughugger
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=en_US.utf8
 LC_TIME=en_DK.utf8
ProcVersionSignature: Ubuntu 2.6.32-13.18-generic
PythonArgs: ['/usr/bin/bughugger']
SourcePackage: bughugger
Title: bughugger crashed with AttributeError in __init__()
Uname: Linux 2.6.32-13-generic x86_64
UserGroups: adm admin audio cdrom dialout fuse kvm libvirtd lpadmin netdev plugdev sambashare vboxusers

Revision history for this message
C de-Avillez (hggdh2) wrote :
tags: removed: need-duplicate-check
Revision history for this message
C de-Avillez (hggdh2) wrote :

This seems to be a known error on python-httplib2 0.5.0, on a failure to connect. See http://code.google.com/p/httplib2/issues/detail?id=62

Still looking at what might have caused it, and if this is fixed on newer python-httplib2 0.6.0

visibility: private → public
Revision history for this message
C de-Avillez (hggdh2) wrote :

ah, and I found my problem: /etc/hosts had 127.0.1.1 localhost. It should have been 127.0.0.1 instead.

Of course, there is still a mismatch: if couchdb expects to connect to localhost, it also should open the listener on the associated IP address, not hard-code it to 127.0.0.1.

So:

(1) python-httplib2 returned an AttributeError instead of a 'connection refused'; the patch above seems to fix it.
(2) couchdb seems to open a listener on 127.0.0.1:40221, but provides the URL as "localhost:40221". usually localhost *is* 127.0.0.1,but not always.

Not sure what to do now, though. I feel this should be documented somewhere, but I do not know where.

Revision history for this message
C de-Avillez (hggdh2) wrote :

resetting package to python-httplib2, since the error is there. It does not seem the patch has made it into 0.6 yet.

affects: bughugger (Ubuntu) → python-httplib2 (Ubuntu)
summary: - bughugger crashed with AttributeError in __init__()
+ python-httplib2 crashes with AttributeError in __init__() if connection
+ refused
Revision history for this message
C de-Avillez (hggdh2) wrote :

I am opening a new bug for couchdb on the error (2) above.

Changed in python-httplib2 (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
rebecacaca (rsdavies) wrote :

I found a hint for a solution here:
https://bugs.launchpad.net/ubuntu/+source/python-httplib2/+bug/523327

Basically, check your /etc/hosts file has the following:

127.0.0.1 localhost
127.0.1.1 computer name

Mine had "username-laptop" where it should have had "computer name". After changing this it works perfectly.

Revision history for this message
rebecacaca (rsdavies) wrote :

Sorry, that was commented in the wrong window.

Revision history for this message
Bryce Harrington (bryce) wrote :

The patch attached to upstream bug 131 looks like it should be SRU'd to maverick and natty (both of which ship 0.6.0) and perhaps lucid: http://code.google.com/p/httplib2/issues/detail?id=131

That patch makes httplib2 raise the correct exception when encountering the error - socket timeout, instead of the confusing AttributeError. That's not a complete fix for this (and may invalidate any bandaids people might have added for ubuntuone, gwibber, or other apps), so I'm not 100% sure it's SRU-worthy.

Looks like oneiric has moved to 0.7x which includes this patch already.

Revision history for this message
Bryce Harrington (bryce) wrote :
Changed in python-httplib2 (Ubuntu):
status: Confirmed → Triaged
importance: Medium → High
Changed in python-httplib2 (Ubuntu Maverick):
status: New → Triaged
Changed in python-httplib2 (Ubuntu Natty):
status: New → Triaged
Changed in python-httplib2 (Ubuntu Maverick):
importance: Undecided → High
Changed in python-httplib2 (Ubuntu Natty):
importance: Undecided → High
tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-httplib2 (Ubuntu Lucid):
status: New → Confirmed
Changed in python-httplib2 (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
JC Hulce (soaringsky) wrote :

This bug affects Ubuntu 10.10, Maverick Meerkat. Maverick has reached end-of-life and is no longer supported, so I am closing the bugtask for Maverick. Please upgrade to a newer version of Ubuntu.
More information here: https://lists.ubuntu.com/archives/ubuntu-announce/2012-April/000158.html

Changed in python-httplib2 (Ubuntu Maverick):
status: Triaged → Invalid
Revision history for this message
dino99 (9d9) wrote :
Changed in python-httplib2 (Ubuntu Natty):
status: Triaged → Invalid
Revision history for this message
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in python-httplib2 (Ubuntu Lucid):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.