Call to _construct_http_client should use self.api_version

Bug #1580319 reported by Scott DAngelo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-cinderclient
Fix Released
Critical
Scott DAngelo

Bug Description

Description
===========
Using the current version of python-cinderclient on master with Nova, an attempt to attach a volume will fail. It appears that the new parameter "api_version" in the cinderclient is the cause.

Steps to reproduce
==================
1. Deploy Devstack
2. clone the python-cinderclient repo to get the latest version on master
   /opt/stack$ git clone git://git.openstack.org/openstack/python-cinderclient.git
3. remove the existing cinderclient from /usr/local/lib/python2.7/dist-packages
   sudo rm -rf /usr/local/lib/python2.7/dist-packages/cinderclient
4. link the latest version:
   sudo cp -rs /opt/stack/python-cinderclient/cinderclient /urr/local/lib/python2.7/dist-packages/
5. Create a volume
   cinder create 1
6. Boot a Nova instance
   nova boot --image <image_id> --flavor 1 VM0
7. Attempt to attach the volume
   nova volume-attach <instance_id> <volume_id> /dev/vdc

Expected result
===============
Volume attach succeeds

Actual result
=============
scott@DevMay9:~/devstack$ nova volume-attach c6ecc894-2e1a-42c5-ba9c-51d1c0c5b1da f87a00d5-22e3-4a36-8b8a-8cc0b3121b61 /dev/vdc
ERROR (ClientException): Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<type 'exceptions.TypeError'> (HTTP 500) (Request-ID: req-902e1982-5aac-45cc-b129-8e2df12744aa)

n-api logs:
2016-05-10 13:36:04.799 ERROR nova.api.openstack.extensions [req-902e1982-5aac-45cc-b129-8e2df12744aa demo demo] Unexpected exception in API method
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions Traceback (most recent call last):
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/extensions.py", line 478, in wrapped
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions return f(*args, **kwargs)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/validation/__init__.py", line 73, in wrapper
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions return func(*args, **kwargs)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/compute/volumes.py", line 316, in create
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions volume_id, device)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/compute/api.py", line 169, in wrapped
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions return func(self, context, target, *args, **kwargs)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/compute/api.py", line 158, in inner
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions return function(self, context, instance, *args, **kwargs)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/compute/api.py", line 139, in inner
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions return f(self, context, instance, *args, **kw)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/compute/api.py", line 3173, in attach_volume
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions disk_bus, device_type)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/compute/api.py", line 3115, in _attach_volume
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions volume_bdm.destroy()
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 221, in __exit__
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions self.force_reraise()
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 197, in force_reraise
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions six.reraise(self.type_, self.value, self.tb)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/compute/api.py", line 3111, in _attach_volume
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions self._check_attach_and_reserve_volume(context, volume_id, instance)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/compute/api.py", line 3096, in _check_attach_and_reserve_volume
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions volume = self.volume_api.get(context, volume_id)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/volume/cinder.py", line 187, in wrapper
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions res = method(self, ctx, *args, **kwargs)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/volume/cinder.py", line 210, in wrapper
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions res = method(self, ctx, volume_id, *args, **kwargs)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/volume/cinder.py", line 256, in get
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions item = cinderclient(context).volumes.get(volume_id)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/volume/cinder.py", line 102, in cinderclient
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions **service_parameters)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/usr/local/lib/python2.7/dist-packages/cinderclient/client.py", line 634, in Client
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/usr/local/lib/python2.7/dist-packages/cinderclient/v2/client.py", line 119, in __init__
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions **kwargs)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/usr/local/lib/python2.7/dist-packages/cinderclient/client.py", line 551, in _construct_http_client
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions bypass_url=None, retries=None,
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions File "/usr/local/lib/python2.7/dist-packages/positional/__init__.py", line 101, in inner
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions return wrapped(*args, **kwargs)
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions TypeError: __init__() got an unexpected keyword argument 'api_version'
2016-05-10 13:36:04.799 TRACE nova.api.openstack.extensions

Environment
===========
scott@DevMay9:/opt/stack/nova$ git log -1
commit 421c52d9d341b07d850c21e0e702a008a8e1d3b7
Merge: cb0740a 8f4e803
Author: Jenkins <email address hidden>
Date: Tue May 10 15:37:46 2016 +0000

    Merge "api-ref: complete verification for diagnostics.inc"

Tags: volumes
tags: added: volumes
Matt Riedemann (mriedem)
Changed in nova:
status: New → Invalid
Revision history for this message
Matt Riedemann (mriedem) wrote :

This passed the tempest run with the commit on master, so it must be a local user error. I wouldn't copy files around like this, pip install it to be sure, you could have stale pyc's that are causing issues.

affects: nova → cinder
summary: - unreleased cinderclient fails volume-attach due to new Client parameter
+ Call to _construct_http_client should use self.api_version
Changed in cinder:
status: Invalid → In Progress
assignee: nobody → Scott DAngelo (scott-dangelo)
Changed in cinder:
importance: Undecided → Critical
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/python-cinderclient 1.7.0

This issue was fixed in the openstack/python-cinderclient 1.7.0 release.

Revision history for this message
Scott DAngelo (scott-dangelo) wrote :

Fixed with:
030dedf9e8beb89784ab112977716f9b96073195

Changed in cinder:
status: In Progress → Fix Released
Eric Harney (eharney)
Changed in python-cinderclient:
milestone: none → 1.7.0
assignee: nobody → Scott DAngelo (scott-dangelo)
importance: Undecided → Critical
status: New → Fix Released
no longer affects: cinder
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.