v2 image data upload raises exception
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
Critical
|
Stuart McLaren | ||
Grizzly |
Fix Released
|
Critical
|
Stuart McLaren |
Bug Description
With the latest devstack:
curl -i -k -X PUT -H 'Co -H "x-auth-token: $TOKEN"ntent-Type: application/
HTTP/1.1 500 Internal Server Error
Content-Type: text/plain
Content-Length: 4988
Date: Tue, 05 Mar 2013 16:24:42 GMT
Connection: close
Traceback (most recent call last):
File "/usr/local/
result = self.applicatio
File "/usr/local/
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/local/
return self.func(req, *args, **kwargs)
File "/opt/stack/
response = req.get_
File "/usr/local/
application, catch_exc_
File "/usr/local/
app_iter = application(
File "/opt/stack/
return self.app(env, start_response)
File "/usr/local/
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/local/
return self.func(req, *args, **kwargs)
File "/opt/stack/
response = req.get_
File "/usr/local/
application, catch_exc_
File "/usr/local/
app_iter = application(
File "/usr/local/
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/local/
return self.func(req, *args, **kwargs)
File "/opt/stack/
response = req.get_
File "/usr/local/
application, catch_exc_
File "/usr/local/
app_iter = application(
File "/usr/local/
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/local/
return self.func(req, *args, **kwargs)
File "/opt/stack/
response = req.get_
File "/usr/local/
application, catch_exc_
File "/usr/local/
app_iter = application(
File "/usr/lib/
return app(environ, start_response)
File "/usr/local/
return resp(environ, start_response)
File "/usr/lib/
response = self.app(environ, start_response)
File "/usr/local/
return resp(environ, start_response)
File "/usr/local/
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/local/
return self.func(req, *args, **kwargs)
File "/opt/stack/
request, **action_args)
File "/opt/stack/
return method(*args, **kwargs)
File "/opt/stack/
return func(self, req, *args, **kwargs)
File "/opt/stack/
image.
File "/opt/stack/
self.
File "/opt/stack/
self.
File "/opt/stack/
self.
File "/opt/stack/
self.
File "/opt/stack/
return store.add(image_id, data, size)
File "/opt/stack/
content_
File "/opt/stack/
orig_pos = tell()
UnsupportedOper
From debug, with the v1 api we pass a
CooperativeReader objet to swift whereas with v2 we pass a BufferedReader.
the following change:
$ git diff
diff --git a/glance/
index 1e67382..1724a8f 100644
--- a/glance/
+++ b/glance/
@@ -48,7 +48,7 @@ class ImageDataContro
image_repo = self.gateway.
try:
image = image_repo.
- image.set_
+ image.set_
except exception.
msg = _("Unable to upload duplicate image data for image: %s")
allows the data to be uploaded ok:
$ curl -i -k -X PUT -H "x-auth-token: $TOKEN" -H 'Content-Type: application/
HTTP/1.1 204 No Content
Content-Type: text/html; charset=UTF-8
Content-Length: 0
X-Openstack-
Date: Tue, 05 Mar 2013 16:31:52 GMT
Changed in glance: | |
assignee: | nobody → Stuart McLaren (stuart-mclaren) |
Changed in glance: | |
status: | Fix Committed → Fix Released |
Proposed diff looks like a good fix.