AttributeError: 'CooperativeReader' object has no attribute 'read'

Bug #1039212 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Critical
Dan Prince

Bug Description

Using the latest version of Glance Folsom I'm seeing the following response when trying to create an image snapshot:

2012-08-20 20:20:53 ERROR glance.api.v1.images [3e37a153-fea6-44fb-80da-a3de99cb427c 49c6c4b4aa7f4204805f7c24f484bfb0 71c44062a2914a058c90448bc3d07de5] Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/glance/api/v1/images.py", line 387, in _upload
    image_meta['size'])
  File "/usr/lib/python2.7/site-packages/glance/store/swift.py", line 492, in add
    content_length=content_length)
  File "/usr/lib/python2.7/site-packages/swiftclient/client.py", line 1060, in put_object
    headers=headers)
  File "/usr/lib/python2.7/site-packages/swiftclient/client.py", line 962, in _retry
    rv = func(self.url, self.token, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/swiftclient/client.py", line 793, in put_object
    chunk = contents.read(chunk_size)
  File "/usr/lib/python2.7/site-packages/glance/store/swift.py", line 651, in read
    result = self.fd.read(i)
AttributeError: 'CooperativeReader' object has no attribute 'read'

Dan Prince (dan-prince)
Changed in glance:
assignee: nobody → Dan Prince (dan-prince)
status: New → In Progress
Revision history for this message
Dan Prince (dan-prince) wrote :

Okay. The most recent commit 3c69df5aa707b4216ef7001dbe28fa0a5912493c seems to be the culprit. (Make max image size upload configurable)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/11686

Dan Prince (dan-prince)
Changed in glance:
importance: Undecided → Critical
milestone: none → folsom-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/11686
Committed: http://github.com/openstack/glance/commit/a6de4de65b01df6851fd573260fbbd8bbe53431f
Submitter: Jenkins
Branch: master

commit a6de4de65b01df6851fd573260fbbd8bbe53431f
Author: Dan Prince <email address hidden>
Date: Mon Aug 20 21:29:44 2012 -0400

    Convert limiting_iter to LimitingReader.

    Glance commit 3c69df5aa707b4216ef7001dbe28fa0a5912493c added a new
    limiting_iter function in utils which we use to limit reads to
    image data being uploaded. This simple generator doesn't work
    with image backends like the Swift store which require a 'read'
    method.

    This patch swaps out the simple limiting_iter function for a
    LimitingReader class which supports both 'read' and __iter__
    functions.

    Fixes LP Bug #1039212 which cause the exception below when used
    with the previous code:

    AttributeError: 'CooperativeReader' object has no attribute 'read'

    Change-Id: I87d9a30f7afe0207386d621050312374ced161d5

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: folsom-rc1 → 2012.2
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.