← Back to team overview

openstack team mailing list archive

[folsom] Swift-backed glance fails x-glance-api-copy-from

 

We've set up a glance server, backed by a swift cluster. Regular uploads
with the cli work fine. However, when I try to upload an image via
Horizon, the upload fails. The log states: TypeError: object of type
'CooperativeReader' has no len(). Is this a bug, or is it a
configuration error on our side?

Regards,
Koert van der Veer, CloudVPS

The actual upload request is:


The full packet capture can be found here:
http://www.cloudshark.org/captures/f23d29d12471

PUT /v1/images/d003b1e8-be68-4de2-a969-eeccfda0bc27 HTTP/1.1
Host: glance.tst.xl-is.net:9292
Accept-Encoding: identity
x-glance-api-copy-from:
http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img
Content-Type: application/octet-stream
X-Auth-Token: 298a35765cf74474b6a0bd9601b6c565
User-Agent: python-glanceclient

The logged exception is:

ERROR glance.api.v1.images [-] Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-ackages/glance/api/v1/images.py", line
437, in _upload
    image_meta['size'])
  File "/usr/lib/python2.7/dist-packages/glance/store/swift.py", line
464, in add
    content_length=image_size)
  File "/usr/lib/python2.7/dist-packages/swiftclient/client.py", line
1079, in put_object
    headers=headers)
  File "/usr/lib/python2.7/dist-packages/swiftclient/client.py", line
981, in _retry
    rv = func(self.url, self.token, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/swiftclient/client.py", line
828, in put_object
    conn.request('PUT', path, contents, headers)
  File "/usr/lib/python2.7/httplib.py", line 958, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 992, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 818, in _send_output
    self.send(message_body)
  File "/usr/lib/python2.7/httplib.py", line 790, in send
    self.sock.sendall(data)
  File "/usr/lib/python2.7/dist-packages/eventlet/greenio.py", line 283,
in sendall
    tail = self.send(data, flags)
  File "/usr/lib/python2.7/dist-packages/eventlet/greenio.py", line 265,
in send
    len_data = len(data)
TypeError: object of type 'CooperativeReader' has no len()

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups