ryan-roemer / django-cloud-browser

Django application browser for cloud datastores (Rackspace, AWS, etc.).
http://ryan-roemer.github.com/django-cloud-browser/
MIT License
81 stars 27 forks source link

Odd NoneType object has no attribute makefile error #3

Closed stugots closed 11 years ago

stugots commented 11 years ago

The user didn't see any errors, but cloud_browser called cloudfiles which called httplib which got upset. Ever see this before?

.
.
.

File "/usr/local/lib/python2.7/dist-packages/cloud_browser/cloud/rackspace.py", line 206, in _get_object_infos
   limit=limit, delimiter=SEP, prefix=path, marker=marker)

 File "/usr/local/lib/python2.7/dist-packages/cloudfiles/utils.py", line 45, in decorator
   return f(*args, **kwargs)

 File "/usr/local/lib/python2.7/dist-packages/cloudfiles/container.py", line 377, in list_objects_info
   prefix, limit, marker, path, delimiter, **parms)

 File "/usr/local/lib/python2.7/dist-packages/cloudfiles/utils.py", line 45, in decorator
   return f(*args, **kwargs)

 File "/usr/local/lib/python2.7/dist-packages/cloudfiles/container.py", line 427, in _list_objects_raw
   response = self.conn.make_request('GET', [self.name], parms=parms)

 File "/usr/local/lib/python2.7/dist-packages/cloudfiles/connection.py", line 189, in make_request
   response = retry_request()

 File "/usr/local/lib/python2.7/dist-packages/cloudfiles/connection.py", line 183, in retry_request
   return self.connection.getresponse()

 File "/usr/lib/python2.7/httplib.py", line 1028, in getresponse
   response = self.response_class(*args, **kwds)

 File "/usr/lib/python2.7/httplib.py", line 346, in __init__
   self.fp = sock.makefile('rb', 0)

AttributeError: 'NoneType' object has no attribute 'makefile'
ryan-roemer commented 11 years ago

Hi John!

Unfortunately, this error doesn't ring a bell. Doing some quick googling, it looks like it is a quirk of httplib2 as it pops up in other wrapping libraries than Rackspace's cloudfiles lib. Here's some basic refs:

The only thing I saw like relating to the python-cloudfiles library was when also using Gevent, which I assume you're not doing: https://github.com/rackspace/python-cloudfiles/issues/65

I do have a Rackspace account, so if you can give me reproduction steps and versions of: cloudfiles and httplib2, I can try it out myself.

If it's just intermittent, you may want to look to upgrading cloudfiles and/or httplib2, if you haven't already done so.

-Ryan

stugots commented 11 years ago

Roger that. Thank you for looking! I'm about to update a bunch of our packages, including cloud files and httplib2. If the gremlin doesn't disappear && persists, I'll delve into the library code.