Bug 1290548 - Cinder create volume from image: AttributeError: 'Schema' object has no attribute 'is_base_property'
Summary: Cinder create volume from image: AttributeError: 'Schema' object has no attri...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-glanceclient
Version: 7.0 (Kilo)
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: async
: 7.0 (Kilo)
Assignee: Flavio Percoco
QA Contact: nlevinki
URL:
Whiteboard:
: 1309475 (view as bug list)
Depends On:
Blocks: 1280362 1291385 1292884
TreeView+ depends on / blocked
 
Reported: 2015-12-10 18:50 UTC by Eric Harney
Modified: 2019-09-12 09:32 UTC (History)
14 users (show)

Fixed In Version: python-glanceclient-0.17.3-1.el7ost
Doc Type: Bug Fix
Doc Text:
Proposed erratum text: When the previous version of python-glanceclient (0.17.0) was used with the most recent version of openstack-cinder, it became impossible to create volumes out of images. This was traced down to an issue which was resolved by a later python-glanceclient package. By rebasing to version 0.17.3 of python-glanceclient, the issue is resolved and volumes may again be created out of images (BZ#1290548) Cause: A change in openstack-cinder causes regressions with older versions of python-glanceclient Consequence: Images can not be used to create volumes. Fix: Update python-glanceclient to 0.17.3 Result: Images can be used to create volumes.
Clone Of:
: 1291385 1292884 (view as bug list)
Environment:
Last Closed: 2015-12-21 18:03:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1280362 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Product Errata RHBA-2015:2683 0 normal SHIPPED_LIVE python-glanceclient bug fix advisory 2015-12-21 23:03:17 UTC

Internal Links: 1280362

Description Eric Harney 2015-12-10 18:50:49 UTC
Cinder create volume from image fails on

openstack-cinder-2015.1.2-3.el7ost and openstack-cinder-2015.1.2-4.el7ost with this error.

This seems to be related to the patch introduced in bug 1280362. "Fix properties extracting from image with glance api".

> Traceback (most recent call last): 
> 2015-12-10 10:52:31.774 325 TRACE cinder.volume.api File "/usr/lib/python2.7/site-packages/taskflow/engines/action_engine/executor.py", line 67, in _execute_task 
> 2015-12-10 10:52:31.774 325 TRACE cinder.volume.api result = task.execute(**arguments) 
> 2015-12-10 10:52:31.774 325 TRACE cinder.volume.api File "/usr/lib/python2.7/site-packages/cinder/volume/flows/api/create_volume.py", line 417, in execute 
> 2015-12-10 10:52:31.774 325 TRACE cinder.volume.api self._check_image_metadata(context, image_id, size) 
> 2015-12-10 10:52:31.774 325 TRACE cinder.volume.api File "/usr/lib/python2.7/site-packages/cinder/volume/flows/api/create_volume.py", line 251, in _check_image_metadata 
> 2015-12-10 10:52:31.774 325 TRACE cinder.volume.api image_meta = self.image_service.show(context, image_id) 
> 2015-12-10 10:52:31.774 325 TRACE cinder.volume.api File "/usr/lib/python2.7/site-packages/cinder/image/glance.py", line 243, in show 
> 2015-12-10 10:52:31.774 325 TRACE cinder.volume.api base_image_meta = self._translate_from_glance(context, image) 
> 2015-12-10 10:52:31.774 325 TRACE cinder.volume.api File "/usr/lib/python2.7/site-packages/cinder/image/glance.py", line 366, in _translate_from_glance 
> 2015-12-10 10:52:31.774 325 TRACE cinder.volume.api for key in image.keys() 
> 2015-12-10 10:52:31.774 325 TRACE cinder.volume.api File "/usr/lib/python2.7/site-packages/cinder/image/glance.py", line 367, in <dictcomp> 
> 2015-12-10 10:52:31.774 325 TRACE cinder.volume.api if self._image_schema.is_base_property(key) is True 
> 2015-12-10 10:52:31.774 325 TRACE cinder.volume.api AttributeError: 'Schema' object has no attribute 'is_base_property' 
>

Comment 1 Sergey Gotliv 2015-12-11 10:17:06 UTC
Eric, 

It fixed in that version of the glanceclient [1] which we released together with the cinder to fix BZ#1280362.

Did you try to use openstack-cinder-2015.1.2-3.el7ost and openstack-cinder-2015.1.2-4.el7ost with that version of the glanceclient?

[1] python-glanceclient-0.14.2-3.el7ost

Comment 3 Ariel Opincaru 2015-12-16 14:26:44 UTC
Happens also with openstack-cinder-2015.1.2-5.el7ost.noarch.

This causes some [*] tempest test to be failed.
Since tempest doesn't use python-glanceclient, I'm not sure if the python-glanceclient is the issue here.

I tried to run the tempest test on two setup, on one the tests have passed and on the other they have failed.
I found the only difference between the two setups is the openstack-cinder version, on one (passed) openstack-cinder-2015.1.2-2.el7ost.noarch and on the other (failed) openstack-cinder-2015.1.2-5.el7ost.noarch.


[*] lists of failed tempest tests:
tempest.api.volume.test_volumes_actions.VolumesV1ActionsTest.test_volume_upload
tempest.api.volume.test_volumes_actions.VolumesV2ActionsTest.test_volume_upload
tempest.api.volume.test_volumes_get.VolumesV1GetTest.test_volume_create_get_update_delete_from_image
tempest.api.volume.test_volumes_get.VolumesV2GetTest.test_volume_create_get_update_delete_from_image



###########################################################################

(tempest_us)[stack@instack tempest]$ python -m testtools.run tempest.api.volume.test_volumes_get.VolumesV1GetTest.test_volume_create_get_update_delete_from_image
Tests running...
======================================================================
FAIL: tempest.api.volume.test_volumes_get.VolumesV1GetTest.test_volume_create_get_update_delete_from_image[id-54a01030-c7fc-447c-86ee-c1182beae638,image,smoke]
----------------------------------------------------------------------
pythonlogging:'': {{{
2015-12-16 09:17:13,244 11625 INFO     [tempest_lib.common.rest_client] Request (VolumesV1GetTest:test_volume_create_get_update_delete_from_image): 200 POST http://192.0.2.6:5000/v2.0/tokens
2015-12-16 09:17:13,245 11625 DEBUG    [tempest_lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}
        Body: <omitted>
    Response - Headers: {'status': '200', 'content-length': '4075', 'vary': 'X-Auth-Token', 'connection': 'close', 'date': 'Wed, 16 Dec 2015 14:17:13 GMT', 'content-type': 'application/json', 'x-openstack-request-id': 'req-5ba93c2b-245c-415a-96d1-597eba185634'}
        Body: {"access": {"token": {"issued_at": "2015-12-16T14:17:13.238694", "expires": "2015-12-16T15:17:13Z", "id": "f5b3876115274504ad8e27d2c19ac38b", "tenant": {"description": "VolumesV1GetTest-784157842-desc", "enabled": true, "id": "e720ce3116cb43ae9737af934dd179fe", "name": "VolumesV1GetTest-784157842"}, "audit_ids": ["6qe6XGZmQqmnfa8AAJ_2Cw"]}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.0.2.6:8774/v2/e720ce3116cb43ae9737af934dd179fe", "region": "regionOne", "internalURL": "http://192.0.2.6:8774/v2/e720ce3116cb43ae9737af934dd179fe", "id": "2e20bcb1838145c383a9c7afeb8194cb", "publicURL": "http://192.0.2.6:8774/v2/e720ce3116cb43ae9737af934dd179fe"}], "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": "http://192.0.2.6:9696/", "region": "regionOne", "internalURL": "http://192.0.2.6:9696/", "id": "ac448457dce748aaa183dd376fc0ef88", "publicURL": "http://192.0.2.6:9696/"}], "endpoints_links": [], "type": "network", "name": "neutron"}, {"endpoints": [{"adminURL": "http://192.0.2.6:8776/v2/e720ce3116cb43ae9737af934dd179fe", "region": "regionOne", "internalURL": "http://192.0.2.6:8776/v2/e720ce3116cb43ae9737af934dd179fe", "id": "76dce2d36420425797ea779d6773c576", "publicURL": "http://192.0.2.6:8776/v2/e720ce3116cb43ae9737af934dd179fe"}], "endpoints_links": [], "type": "volumev2", "name": "cinderv2"}, {"endpoints": [{"adminURL": "http://192.0.2.6:8774/v3", "region": "regionOne", "internalURL": "http://192.0.2.6:8774/v3", "id": "80b7ff9a4b654e89a5787d014fad7fdb", "publicURL": "http://192.0.2.6:8774/v3"}], "endpoints_links": [], "type": "computev3", "name": "nova"}, {"endpoints": [{"adminURL": "http://192.0.2.6:9292/", "region": "regionOne", "internalURL": "http://192.0.2.6:9292/", "id": "1562544839e94bf3a2e2a23cf57d1ec7", "publicURL": "http://192.0.2.6:9292/"}], "endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": "http://192.0.2.6:8777/", "region": "regionOne", "internalURL": "http://192.0.2.6:8777/", "id": "2d8a2a2860954f648869d1dfedf8da0b", "publicURL": "http://192.0.2.6:8777/"}], "endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints": [{"adminURL": "http://192.0.2.6:8776/v1/e720ce3116cb43ae9737af934dd179fe", "region": "regionOne", "internalURL": "http://192.0.2.6:8776/v1/e720ce3116cb43ae9737af934dd179fe", "id": "07f25a6c9eee4c13bd6949c5423618b0", "publicURL": "http://192.0.2.6:8776/v1/e720ce3116cb43ae9737af934dd179fe"}], "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": [{"adminURL": "http://192.0.2.6:80/dashboard/admin", "region": "regionOne", "internalURL": "http://192.0.2.6:80/dashboard/", "id": "645f3fa14e694e9da6e59b4d9ce7cb5e", "publicURL": "http://192.0.2.6:80/dashboard/"}], "endpoints_links": [], "type": "dashboard", "name": "horizon"}, {"endpoints": [{"adminURL": "http://192.0.2.6:8004/v1/e720ce3116cb43ae9737af934dd179fe", "region": "regionOne", "internalURL": "http://192.0.2.6:8004/v1/e720ce3116cb43ae9737af934dd179fe", "id": "551ad0a68a164eb9b11fcdf22b9f75d7", "publicURL": "http://192.0.2.6:8004/v1/e720ce3116cb43ae9737af934dd179fe"}], "endpoints_links": [], "type": "orchestration", "name": "heat"}, {"endpoints": [{"adminURL": "http://192.0.2.6:8080/v1", "region": "regionOne", "internalURL": "http://192.0.2.6:8080/v1/AUTH_e720ce3116cb43ae9737af934dd179fe", "id": "24632a16c52e4c76bcf569d3cc18968a", "publicURL": "http://192.0.2.6:8080/v1/AUTH_e720ce3116cb43ae9737af934dd179fe"}], "endpoints_links": [], "type": "object-store", "name": "swift"}, {"endpoints": [{"adminURL": "http://192.0.2.6:35357/v2.0", "region": "regionOne", "internalURL": "http://192.0.2.6:5000/v2.0", "id": "51a4ae6556894c3e8b4614acd147bfac", "publicURL": "http://192.0.2.6:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username": "VolumesV1GetTest-1715623987", "roles_links": [], "id": "ca6b314082d74ad08259b4a0e91af21c", "roles": [{"name": "_member_"}], "name": "VolumesV1GetTest-1715623987"}, "metadata": {"is_admin": 0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab"]}}}
2015-12-16 09:17:13,437 11625 INFO     [tempest_lib.common.rest_client] Request (VolumesV1GetTest:test_volume_create_get_update_delete_from_image): 500 POST http://192.0.2.6:8776/v1/e720ce3116cb43ae9737af934dd179fe/volumes 0.192s
2015-12-16 09:17:13,437 11625 DEBUG    [tempest_lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: {"volume": {"metadata": {"Type": "Test"}, "display_name": "Volume-844092640", "imageRef": "19b66288-26c4-4806-b6ad-766829463385", "size": 1}}
    Response - Headers: {'status': '500', 'content-length': '128', 'x-compute-request-id': 'req-3a21f434-35eb-4e77-a316-6650a9dc8319', 'connection': 'close', 'date': 'Wed, 16 Dec 2015 14:17:13 GMT', 'content-type': 'application/json; charset=UTF-8', 'x-openstack-request-id': 'req-3a21f434-35eb-4e77-a316-6650a9dc8319'}
        Body: {"computeFault": {"message": "The server has either erred or is incapable of performing the requested operation.", "code": 500}}
}}}

Traceback (most recent call last):
  File "tempest/test.py", line 126, in wrapper
    return f(self, *func_args, **func_kwargs)
  File "tempest/api/volume/test_volumes_get.py", line 134, in test_volume_create_get_update_delete_from_image
    self._volume_create_get_update_delete(imageRef=CONF.compute.image_ref)
  File "tempest/api/volume/test_volumes_get.py", line 52, in _volume_create_get_update_delete
    volume = self.client.create_volume(**kwargs)
  File "tempest/services/volume/json/volumes_client.py", line 81, in create_volume
    resp, body = self.post('volumes', post_body)
  File "/home/stack/tempest_upstream/tempest_us/lib/python2.7/site-packages/tempest_lib/common/rest_client.py", line 259, in post
    return self.request('POST', url, extra_headers, headers, body)
  File "/home/stack/tempest_upstream/tempest_us/lib/python2.7/site-packages/tempest_lib/common/rest_client.py", line 639, in request
    resp, resp_body)
  File "/home/stack/tempest_upstream/tempest_us/lib/python2.7/site-packages/tempest_lib/common/rest_client.py", line 753, in _error_checker
    message=message)
tempest_lib.exceptions.ServerFault: Got server fault
Details: The server has either erred or is incapable of performing the requested operation.

Ran 1 test in 1.449s
FAILED (failures=1)

###########################################################################

[root@overcloud-controller-0 ~]# tail -f /var/log/cinder/api.log 

2015-12-16 08:42:51.333 944 WARNING cinder.volume.api [req-a5bdf339-1d05-4f04-aab4-200339caa7c8 f1652f96df954901846a0c84e5a258f4 d7bbd17556594c6c87f5382c4fb5b54e - - -] Task 'cinder.volume.flows.api.create_volume.ExtractVolumeRequestTask;volume:create' (16a56b7c-952a-40c0-aa3a-05fdf03d7dc8) transitioned into state 'FAILURE' from state 'RUNNING'
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api Traceback (most recent call last):
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api   File "/usr/lib/python2.7/site-packages/taskflow/engines/action_engine/executor.py", line 67, in _execute_task
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api     result = task.execute(**arguments)
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api   File "/usr/lib/python2.7/site-packages/cinder/volume/flows/api/create_volume.py", line 417, in execute
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api     self._check_image_metadata(context, image_id, size)
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api   File "/usr/lib/python2.7/site-packages/cinder/volume/flows/api/create_volume.py", line 251, in _check_image_metadata
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api     image_meta = self.image_service.show(context, image_id)
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api   File "/usr/lib/python2.7/site-packages/cinder/image/glance.py", line 243, in show
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api     base_image_meta = self._translate_from_glance(context, image)
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api   File "/usr/lib/python2.7/site-packages/cinder/image/glance.py", line 366, in _translate_from_glance
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api     for key in image.keys()
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api   File "/usr/lib/python2.7/site-packages/cinder/image/glance.py", line 367, in <dictcomp>
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api     if self._image_schema.is_base_property(key) is True
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api AttributeError: 'Schema' object has no attribute 'is_base_property'
2015-12-16 08:42:51.333 944 TRACE cinder.volume.api 
2015-12-16 08:42:51.336 944 WARNING cinder.volume.api [req-a5bdf339-1d05-4f04-aab4-200339caa7c8 f1652f96df954901846a0c84e5a258f4 d7bbd17556594c6c87f5382c4fb5b54e - - -] Task 'cinder.volume.flows.api.create_volume.ExtractVolumeRequestTask;volume:create' (16a56b7c-952a-40c0-aa3a-05fdf03d7dc8) transitioned into state 'REVERTED' from state 'REVERTING'
2015-12-16 08:42:51.337 944 WARNING cinder.volume.api [req-a5bdf339-1d05-4f04-aab4-200339caa7c8 f1652f96df954901846a0c84e5a258f4 d7bbd17556594c6c87f5382c4fb5b54e - - -] Flow 'volume_create_api' (2ad82969-5d2a-46de-9c77-0e92a8f82569) transitioned into state 'REVERTED' from state 'RUNNING'
2015-12-16 08:42:51.337 944 ERROR cinder.api.middleware.fault [req-a5bdf339-1d05-4f04-aab4-200339caa7c8 f1652f96df954901846a0c84e5a258f4 d7bbd17556594c6c87f5382c4fb5b54e - - -] Caught error: 'Schema' object has no attribute 'is_base_property'

Comment 5 Flavio Percoco 2015-12-18 14:41:28 UTC
Ariel,

What version of python-glanceclient did you use to test this?

tempest doesn't use glanceclient but cinder does. This should be fixed in: python-glanceclient-0.17.3-1.el7ost but I want to double check you were using the right version of the library.

Comment 8 nlevinki 2015-12-21 15:25:29 UTC
I used python-glanceclient-0.17.0-2.el7ost.noarch on my environment(last puddle for 7.2), while the problem was resolved on build  python-glanceclient-1.1.0-1.el7ost

Comment 11 errata-xmlrpc 2015-12-21 18:03:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2015:2683

Comment 12 Matt Flusche 2016-02-17 23:30:43 UTC
*** Bug 1309475 has been marked as a duplicate of this bug. ***

Comment 13 Ariel Opincaru 2016-05-17 06:00:21 UTC
(In reply to Flavio Percoco from comment #5)
> Ariel,
> 
> What version of python-glanceclient did you use to test this?
> 
> tempest doesn't use glanceclient but cinder does. This should be fixed in:
> python-glanceclient-0.17.3-1.el7ost but I want to double check you were
> using the right version of the library.

Hey,

Sorry for the late response, I don't have/remember the version of python-glanceclient.


Note You need to log in before you can comment on or make changes to this bug.