yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #03469
[Bug 1183049] Re: Doing a GET on v2/images/{id}/file fails
** Changed in: glance
Status: Fix Committed => Fix Released
** Changed in: glance
Milestone: None => havana-2
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1183049
Title:
Doing a GET on v2/images/{id}/file fails
Status in OpenStack Image Registry and Delivery Service (Glance):
Fix Released
Bug description:
(Using Devstack, Glance code as of 2013-05-20)
When attempting to download image data using the V2 api, an error
occurs:
Sample CURL:
curl -i -X GET -H 'Content-Type: application/octet-stream' -H "X-Auth-
Token: $OS_AUTH_TOKEN" http://162.209.48.224:9292/v2/images/eddedf52
-790d-470c-82d6-963479a3d6f9/file --verbose
Result:
* About to connect() to 162.209.48.224 port 9292 (#0)
* Trying 162.209.48.224...
* connected
* Connected to 162.209.48.224 (162.209.48.224) port 9292 (#0)
> GET /v2/images/eddedf52-790d-470c-82d6-963479a3d6f9/file HTTP/1.1
> Host: 162.209.48.224:9292
> Accept: */*
> User-Agent: python-glanceclient
> Content-Type: application/octet-stream
> X-Auth-Token: ...
>
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 500 Internal Server Error
HTTP/1.1 500 Internal Server Error
< Content-Type: text/plain
Content-Type: text/plain
< Content-Length: 2511
Content-Length: 2511
< Date: Wed, 22 May 2013 18:36:09 GMT
Date: Wed, 22 May 2013 18:36:09 GMT
< Connection: close
Connection: close
<
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/eventlet/wsgi.py", line 382, in handle_one_response
result = self.application(self.environ, start_response)
File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
return self.func(req, *args, **kwargs)
File "/opt/stack/glance/glance/common/wsgi.py", line 367, in __call__
response = req.get_response(self.application)
File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296, in send
application, catch_exc_info=False)
File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260, in call_application
app_iter = application(self.environ, start_response)
File "/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py", line 456, in __call__
return self.app(env, start_response)
File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
return self.func(req, *args, **kwargs)
File "/opt/stack/glance/glance/common/wsgi.py", line 367, in __call__
response = req.get_response(self.application)
File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296, in send
application, catch_exc_info=False)
File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260, in call_application
app_iter = application(self.environ, start_response)
File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
return self.func(req, *args, **kwargs)
File "/opt/stack/glance/glance/common/wsgi.py", line 364, in __call__
response = self.process_request(req)
File "/opt/stack/glance/glance/api/middleware/cache.py", line 118, in process_request
return method(request, image_id, image_iterator)
File "/opt/stack/glance/glance/api/middleware/cache.py", line 172, in _process_v2_request
self._verify_metadata(image_meta)
File "/opt/stack/glance/glance/api/middleware/cache.py", line 72, in _verify_metadata
image_meta['size'] = self.cache.get_image_size(image_id)
NameError: global name 'image_id' is not defined
* Closing connection #0
Looking at the _verify_metadata method, the image_id is indeed not
defined. This should likely be passed as a parameter.
https://github.com/openstack/glance/blob/master/glance/api/middleware/cache.py#L60
To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1183049/+subscriptions