← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1476770] Re: _translate_from_glance fails with "AttributeError: id" in grenade

 

I saw this issue as well updating to urllib3 in nova image-show

 nova/image/glance.py's show() method

following is not getting properties

image = self._client.call(context, version, 'get', image_id)

glance api returns image properties with same case as

• X-Image-Meta-Checksum →d41d8cd98f00b204e9800998ecf8427e
• X-Image-Meta-Container_format →bare
• X-Image-Meta-Created_at →2015-08-13T19:12:26.235339
• X-Image-Meta-Deleted →False
• X-Image-Meta-Disk_format →raw
• X-Image-Meta-Id →03dc7a38-6b1b-4464-b2b5-7e517a8bbbcc
• X-Image-Meta-Is_public →True, etc...

So when glance client calls the api, request/adapters.py
build_response() , should convert them into case insensitive like

x-image-meta-checksum, but this is not happening with new urllib3
response object.

They are not converted as expected by the glance client. and then glance
client treats this as no properties retrieved for the image. In fact the
glance api is returning proper response. But because of this conversion
failure, its throwing attribute error.

** Also affects: python-glanceclient
   Importance: Undecided
       Status: New

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

Title:
  _translate_from_glance fails with "AttributeError: id" in grenade

Status in Glance:
  Invalid
Status in OpenStack-Gate:
  Fix Committed
Status in oslo.vmware:
  Fix Released
Status in python-glanceclient:
  New

Bug description:
  http://logs.openstack.org/28/204128/2/check/gate-grenade-
  dsvm/80607dc/logs/old/screen-n-api.txt.gz?level=TRACE

  2015-07-21 17:05:37.447 ERROR nova.api.openstack [req-9854210d-b9fc-47ff-9f00-1a0270266e2a tempest-ServersTestJSON-34270062 tempest-ServersTestJSON-745803609] Caught error: id
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack Traceback (most recent call last):
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/api/openstack/__init__.py", line 125, in __call__
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     return req.get_response(self.application)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1317, in send
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     application, catch_exc_info=False)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1281, in call_application
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     app_iter = application(self.environ, start_response)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     return resp(environ, start_response)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__init__.py", line 634, in __call__
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     return self._call_app(env, start_response)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__init__.py", line 554, in _call_app
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     return self._app(env, _fake_start_response)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     return resp(environ, start_response)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     return resp(environ, start_response)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/routes/middleware.py", line 136, in __call__
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     response = self.app(environ, start_response)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     return resp(environ, start_response)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     resp = self.call_func(req, *args, **self.kwargs)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     return self.func(req, *args, **kwargs)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/api/openstack/wsgi.py", line 756, in __call__
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     content_type, body, accept)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/api/openstack/wsgi.py", line 821, in _process_stack
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     action_result = self.dispatch(meth, request, action_args)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/api/openstack/wsgi.py", line 911, in dispatch
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     return method(req=request, **action_args)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/api/openstack/compute/servers.py", line 636, in create
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     self._handle_create_exception(*sys.exc_info())
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/api/openstack/compute/servers.py", line 465, in _handle_create_exception
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     six.reraise(*exc_info)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/api/openstack/compute/servers.py", line 621, in create
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     check_server_group_quota=check_server_group_quota)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/hooks.py", line 149, in inner
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     rv = f(*args, **kwargs)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/compute/api.py", line 1481, in create
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     check_server_group_quota=check_server_group_quota)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/compute/api.py", line 1077, in _create_instance
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     image_id, boot_meta = self._get_image(context, image_href)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/compute/api.py", line 765, in _get_image
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     image = self.image_api.get(context, image_href)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/image/api.py", line 93, in get
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     show_deleted=show_deleted)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/image/glance.py", line 310, in show
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     include_locations=include_locations)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/image/glance.py", line 484, in _translate_from_glance
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     include_locations=include_locations)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/opt/stack/old/nova/nova/image/glance.py", line 546, in _extract_attributes
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     queued = getattr(image, 'status') == 'queued'
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/glanceclient/openstack/common/apiclient/base.py", line 491, in __getattr__
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     self.get()
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/glanceclient/openstack/common/apiclient/base.py", line 509, in get
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     new = self.manager.get(self.id)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack   File "/usr/local/lib/python2.7/dist-packages/glanceclient/openstack/common/apiclient/base.py", line 494, in __getattr__
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack     raise AttributeError(k)
  2015-07-21 17:05:37.447 21251 TRACE nova.api.openstack AttributeError: id

  Whatever this is it's new:

  http://logstash.openstack.org/#eyJzZWFyY2giOiJtZXNzYWdlOlwiX3RyYW5zbGF0ZV9mcm9tX2dsYW5jZVwiIEFORCBtZXNzYWdlOlwiQXR0cmlidXRlRXJyb3I6IGlkXCIgQU5EIHRhZ3M6XCJzY3JlZW4tbi1hcGkudHh0XCIiLCJmaWVsZHMiOltdLCJvZmZzZXQiOjAsInRpbWVmcmFtZSI6IjYwNDgwMCIsImdyYXBobW9kZSI6ImNvdW50IiwidGltZSI6eyJ1c2VyX2ludGVydmFsIjowfSwic3RhbXAiOjE0Mzc0OTk4MzcwNTl9

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


References