← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1297465] [NEW] ChunkReader has no len() Swiftclient + Glance

 

Public bug reported:

On CentOS 6.5

Name        : openstack-glance
Arch        : noarch
Version     : 2013.2.2
Release     : 2.el6
Size        : 52 k
Repo        : installed
>From repo   : openstack-havana

When uploading an image that is larger than swifts chunk size I receive
a ChunkReader error:

2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils
TypeError: object of type 'ChunkReader' has no len()

2014-03-25 18:29:16.916 21092 TRACE glance.store.swift TypeError: object
of type 'ChunkReader' has no len()

Full Traceback:

2014-03-25 18:29:16.916 21092 ERROR glance.store.swift [34633528-d86d-4055-bdc9-1bcdf872fc2b OpenStack Admin 57813631e9e5420589216b33925ef6a3] Error during chunked upload to backend, deleting stale chunks
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift Traceback (most recent call last):
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/glance/store/swift.py", line 384, in add
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     content_length=content_length)
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 1318, in put_object
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     response_dict=response_dict)
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 1192, in _retry
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     rv = func(self.url, self.token, *args, **kwargs)
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 943, in put_object
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     conn.putrequest(path, headers=headers, data=contents)
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 197, in putrequest
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     return self.request('PUT', full_path, data, headers, files)
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 187, in request
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     files=files, **self.requests_args)
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 176, in _request
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     return requests.request(*arg, **kwarg)
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/requests/api.py", line 44, in request
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     return session.request(method=method, url=url, **kwargs)
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 276, in request
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     prep = req.prepare()
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/requests/models.py", line 224, in prepare
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     p.prepare_body(self.data, self.files)
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/requests/models.py", line 384, in prepare_body
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     self.headers['Content-Length'] = str(len(body))
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift TypeError: object of type 'ChunkReader' has no len()
2014-03-25 18:29:16.916 21092 TRACE glance.store.swift 
2014-03-25 18:29:16.977 21092 ERROR glance.api.v1.upload_utils [34633528-d86d-4055-bdc9-1bcdf872fc2b OpenStack Admin 57813631e9e5420589216b33925ef6a3] Failed to upload image 375a5784-8911-433a-a2c2-56ea0c621eda
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils Traceback (most recent call last):
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/glance/api/v1/upload_utils.py", line 101, in upload_data_to_store
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     store)
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/glance/store/__init__.py", line 333, in store_add_to_backend
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     (location, size, checksum, metadata) = store.add(image_id, data, size)
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/glance/store/swift.py", line 384, in add
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     content_length=content_length)
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 1318, in put_object
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     response_dict=response_dict)
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 1192, in _retry
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     rv = func(self.url, self.token, *args, **kwargs)
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 943, in put_object
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     conn.putrequest(path, headers=headers, data=contents)
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 197, in putrequest
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     return self.request('PUT', full_path, data, headers, files)
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 187, in request
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     files=files, **self.requests_args)
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 176, in _request
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     return requests.request(*arg, **kwarg)
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/requests/api.py", line 44, in request
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     return session.request(method=method, url=url, **kwargs)
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 276, in request
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     prep = req.prepare()
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/requests/models.py", line 224, in prepare
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     p.prepare_body(self.data, self.files)
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/requests/models.py", line 384, in prepare_body
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     self.headers['Content-Length'] = str(len(body))
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils TypeError: object of type 'ChunkReader' has no len()
2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils

** Affects: glance
     Importance: Undecided
         Status: New


** Tags: glance havana swiftclient

** Tags added: havana

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1297465

Title:
  ChunkReader has no len() Swiftclient + Glance

Status in OpenStack Image Registry and Delivery Service (Glance):
  New

Bug description:
  On CentOS 6.5

  Name        : openstack-glance
  Arch        : noarch
  Version     : 2013.2.2
  Release     : 2.el6
  Size        : 52 k
  Repo        : installed
  From repo   : openstack-havana

  When uploading an image that is larger than swifts chunk size I
  receive a ChunkReader error:

  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils
  TypeError: object of type 'ChunkReader' has no len()

  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift TypeError:
  object of type 'ChunkReader' has no len()

  Full Traceback:

  2014-03-25 18:29:16.916 21092 ERROR glance.store.swift [34633528-d86d-4055-bdc9-1bcdf872fc2b OpenStack Admin 57813631e9e5420589216b33925ef6a3] Error during chunked upload to backend, deleting stale chunks
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift Traceback (most recent call last):
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/glance/store/swift.py", line 384, in add
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     content_length=content_length)
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 1318, in put_object
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     response_dict=response_dict)
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 1192, in _retry
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     rv = func(self.url, self.token, *args, **kwargs)
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 943, in put_object
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     conn.putrequest(path, headers=headers, data=contents)
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 197, in putrequest
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     return self.request('PUT', full_path, data, headers, files)
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 187, in request
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     files=files, **self.requests_args)
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 176, in _request
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     return requests.request(*arg, **kwarg)
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/requests/api.py", line 44, in request
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     return session.request(method=method, url=url, **kwargs)
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 276, in request
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     prep = req.prepare()
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/requests/models.py", line 224, in prepare
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     p.prepare_body(self.data, self.files)
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift   File "/usr/lib/python2.6/site-packages/requests/models.py", line 384, in prepare_body
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift     self.headers['Content-Length'] = str(len(body))
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift TypeError: object of type 'ChunkReader' has no len()
  2014-03-25 18:29:16.916 21092 TRACE glance.store.swift 
  2014-03-25 18:29:16.977 21092 ERROR glance.api.v1.upload_utils [34633528-d86d-4055-bdc9-1bcdf872fc2b OpenStack Admin 57813631e9e5420589216b33925ef6a3] Failed to upload image 375a5784-8911-433a-a2c2-56ea0c621eda
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils Traceback (most recent call last):
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/glance/api/v1/upload_utils.py", line 101, in upload_data_to_store
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     store)
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/glance/store/__init__.py", line 333, in store_add_to_backend
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     (location, size, checksum, metadata) = store.add(image_id, data, size)
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/glance/store/swift.py", line 384, in add
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     content_length=content_length)
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 1318, in put_object
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     response_dict=response_dict)
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 1192, in _retry
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     rv = func(self.url, self.token, *args, **kwargs)
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 943, in put_object
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     conn.putrequest(path, headers=headers, data=contents)
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 197, in putrequest
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     return self.request('PUT', full_path, data, headers, files)
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 187, in request
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     files=files, **self.requests_args)
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/swiftclient/client.py", line 176, in _request
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     return requests.request(*arg, **kwarg)
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/requests/api.py", line 44, in request
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     return session.request(method=method, url=url, **kwargs)
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 276, in request
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     prep = req.prepare()
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/requests/models.py", line 224, in prepare
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     p.prepare_body(self.data, self.files)
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils   File "/usr/lib/python2.6/site-packages/requests/models.py", line 384, in prepare_body
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils     self.headers['Content-Length'] = str(len(body))
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils TypeError: object of type 'ChunkReader' has no len()
  2014-03-25 18:29:16.977 21092 TRACE glance.api.v1.upload_utils

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1297465/+subscriptions


Follow ups

References