glance-api raise an error "AttributeError: id" then try to create a VM

Bug #1555999 reported by Dmitrii
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Invalid
High
Denis Puchkin
6.1.x
Fix Released
High
Denis Puchkin
7.0.x
Fix Released
High
Denis Puchkin
8.0.x
Invalid
High
Denis Puchkin
9.x
Invalid
High
MOS Glance

Bug Description

MOS 7.0 cloud with HA.

On VM creation got an error in Horizon:
Error: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-3793cc48-1a73-4ac3-9182-aa456477f6cd)
Error: Unable to launch instance named "vm".

nova-api.log:
2016-03-11 09:24:10.721 8829 INFO nova.api.openstack [req-3793cc48-1a73-4ac3-9182-aa456477f6cd 8600c86b868a42719f6eab8d43c0479d 1b8b82a6a0cb4c4b90ab6bd86558e84a - - -] http://os-central.p7s1ctf.de:8774/v2/1b8b82a6a0cb4c4b90ab6bd86558e84a/servers returned with HTTP 500
2016-03-11 09:24:10.722 8834 INFO nova.osapi_compute.wsgi.server [req-360c15aa-452d-485c-ba70-060cd19e5d3b 42ad058771cd4f64a2eef0ad9c4f99bb b717d8b83fa24d1ba2da7a9a2505e0a6 - - -] 10.252.5.2 "GET /v2/b717d8b83fa24d1ba2da7a9a2505e0a6/flavors/14 HTTP/1.1" status: 200 len: 616 time: 0.0225480
2016-03-11 09:24:10.724 8829 INFO nova.osapi_compute.wsgi.server [req-3793cc48-1a73-4ac3-9182-aa456477f6cd 8600c86b868a42719f6eab8d43c0479d 1b8b82a6a0cb4c4b90ab6bd86558e84a - - -] 10.252.5.10 "POST /v2/1b8b82a6a0cb4c4b90ab6bd86558e84a/servers HTTP/1.1" status: 500 len: 354 time: 0.2435880
2016-03-11 09:24:10.751 8834 INFO nova.osapi_compute.wsgi.server [req-599fda57-a81e-4451-a508-c46739142a68 42ad058771cd4f64a2eef0ad9c4f99bb b717d8b83fa24d1ba2da7a9a2505e0a6 - - -] 10.252.5.2 "GET /v2/b717d8b83fa24d1ba2da7a9a2505e0a6/servers/detail?all_tenants=True&host=7stack5.p7s1ctf.de HTTP/1.1" status: 200 len: 5389 time: 0.1545570
2016-03-11 09:24:10.782 8827 INFO nova.osapi_compute.wsgi.server [req-4ee51ebb-1d17-43ae-a330-20d5cec35378 42ad058771cd4f64a2eef0ad9c4f99bb b717d8b83fa24d1ba2da7a9a2505e0a6 - - -] 10.252.5.2 "GET /v2/b717d8b83fa24d1ba2da7a9a2505e0a6/flavors/13 HTTP/1.1" status: 200 len: 616 time: 0.0264580
2016-03-11 09:24:10.850 8818 ERROR nova.api.openstack [req-2260596b-fb56-47c8-a15b-8fb0c892f317 42ad058771cd4f64a2eef0ad9c4f99bb b717d8b83fa24d1ba2da7a9a2505e0a6 - - -] Caught error: id
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack Traceback (most recent call last):
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/__init__.py", line 125, in __call__
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack return req.get_response(self.application)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1320, in send
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack application, catch_exc_info=False)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack app_iter = application(self.environ, start_response)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack return resp(environ, start_response)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__init__.py", line 634, in __call__
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack return self._call_app(env, start_response)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__init__.py", line 554, in _call_app
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack return self._app(env, _fake_start_response)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack return resp(environ, start_response)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack return resp(environ, start_response)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack response = self.app(environ, start_response)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack return resp(environ, start_response)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 756, in __call__
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack content_type, body, accept)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 821, in _process_stack
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack action_result = self.dispatch(meth, request, action_args)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 911, in dispatch
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack return method(req=request, **action_args)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/images.py", line 83, in show
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack image = self._image_api.get(context, id)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/image/api.py", line 93, in get
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack show_deleted=show_deleted)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/image/glance.py", line 310, in show
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack include_locations=include_locations)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/image/glance.py", line 484, in _translate_from_glance
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack include_locations=include_locations)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/image/glance.py", line 546, in _extract_attributes
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack queued = getattr(image, 'status') == 'queued'
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/glanceclient/openstack/common/apiclient/base.py", line 491, in __getattr__
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack self.get()
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/glanceclient/openstack/common/apiclient/base.py", line 509, in get
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack new = self.manager.get(self.id)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/glanceclient/openstack/common/apiclient/base.py", line 494, in __getattr__
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack raise AttributeError(k)
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack AttributeError: id
2016-03-11 09:24:10.850 8818 TRACE nova.api.openstack
2016-03-11 09:24:10.852 8818 INFO nova.api.openstack [req-2260596b-fb56-47c8-a15b-8fb0c892f317 42ad058771cd4f64a2eef0ad9c4f99bb b717d8b83fa24d1ba2da7a9a2505e0a6 - - -] http://10.252.5.2:8774/v2/b717d8b83fa24d1ba2da7a9a2505e0a6/images/7cf1e378-13d2-42fa-ac70-4d7b7178e9e6 returned with HTTP 500
2016-03-11 09:24:10.854 8818 INFO nova.osapi_compute.wsgi.server [req-2260596b-fb56-47c8-a15b-8fb0c892f317 42ad058771cd4f64a2eef0ad9c4f99bb b717d8b83fa24d1ba2da7a9a2505e0a6 - - -] 10.252.5.2 "GET /v2/b717d8b83fa24d1ba2da7a9a2505e0a6/images/7cf1e378-13d2-42fa-ac70-4d7b7178e9e6 HTTP/1.1" status: 500 len: 354 time: 0.1288309

Looks similar with a bug https://bugs.launchpad.net/glance/+bug/1476770

Revision history for this message
Kairat Kushaev (kkushaev) wrote :

What is glance-client version you use?

Revision history for this message
Kairat Kushaev (kkushaev) wrote :

Let me describe it in details: is it possible to upgrade to version equal to 0.17.3 or newer?
Could you also please try to launch an instance again after that? This allows to ensure that the case is the same.

Dina Belova (dbelova)
tags: added: area-glance
Revision history for this message
Denis Puchkin (dpuchkin) wrote :
Revision history for this message
Mike Fedosin (mfedosin) wrote :

Related fix in upstream stable/kilo https://review.openstack.org/#/c/244748/

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/python-glanceclient (openstack-ci/fuel-7.0/2015.1.0)

Fix proposed to branch: openstack-ci/fuel-7.0/2015.1.0
Change author: David Sariel <email address hidden>
Review: https://review.fuel-infra.org/18019

Revision history for this message
Denis Puchkin (dpuchkin) wrote :

invalid for 8.0 and 9.0, because releases since 8.0 versions already contain this fix

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/python-glanceclient (openstack-ci/fuel-7.0/2015.1.0)

Reviewed: https://review.fuel-infra.org/18019
Submitter: Vitaly Sedelnik <email address hidden>
Branch: openstack-ci/fuel-7.0/2015.1.0

Commit: faad446b3e87a4f8bdee49fe8fb32d5d614ebd71
Author: David Sariel <email address hidden>
Date: Mon Mar 14 10:30:55 2016

Invalid output running the command 'glance image-show <image_id>'

Running the command returns the string 'id' and fails on exception.
In function _image_meta_from_headers the meta variable was not properly
set because key was not lowercased. Converting key to lowercase solves
the problem.

NOTE: this is a compatibility fix for urllib3 >= 1.11

Closes-Bug: #1555999
Co-Authored-by: Flavio Percoco <email address hidden>
Cherry-pick from: 2c7da7cb6077b89a7e195f76ed092ea7dfe65e02
Change-Id: I1b0b327163577585becb5e762536058d21dc1c98

tags: added: on-verification
Revision history for this message
Ekaterina Shutova (eshutova) wrote :

Verified on MOS 7.0 + mu3 updates.

Scenario:
On controller
> glance image-show <image-id>
> install urllib3>= 1.11
> glance image-show <image-id>

tags: removed: on-verification
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/python-glanceclient (openstack-ci/fuel-6.1/2014.2)

Reviewed: https://review.fuel-infra.org/18029
Submitter: Vitaly Sedelnik <email address hidden>
Branch: openstack-ci/fuel-6.1/2014.2

Commit: b3a84489201d2456998dbdf9e565e09fc58a33e5
Author: David Sariel <email address hidden>
Date: Mon Mar 14 14:09:28 2016

Invalid output running the command 'glance image-show <image_id>'

Running the command returns the string 'id' and fails on exception.
In function _image_meta_from_headers the meta variable was not properly
set because key was not lowercased. Converting key to lowercase solves
the problem.

NOTE: this is a compatibility fix for urllib3 >= 1.11

Closes-Bug: #1555999
Co-Authored-by: Flavio Percoco <email address hidden>
Cherry-pick from: 2c7da7cb6077b89a7e195f76ed092ea7dfe65e02
Change-Id: I1b0b327163577585becb5e762536058d21dc1c98

tags: added: on-verification
Revision history for this message
Ekaterina Shutova (eshutova) wrote :

Verified on MOS 6.1 + mu6 updates.

Used scenario described above.

tags: removed: on-verification
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.