volume create fails with auth type token_endpoint

Bug #1619726 reported by Loic Dachary
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Won't Fix
Undecided
Unassigned

Bug Description

Steps to reproduce

export OS_URL=https://volume.compute.gra1.cloud.ovh.net/v2/131b886b156a4f84b5f41baf2fbe646c
export OS_TOKEN=$(openstack token issue -f value -c id)

$ openstack --debug volume create --size 1 abc
options: Namespace(access_token='***', access_token_endpoint='', access_token_type='', auth_type='', auth_url='https://auth.cloud.ovh.net/v2.0', authorization_code='', cacert=None, cert='', client_id='', client_secret='***', cloud='', debug=True, default_domain='default', default_domain_id='', default_domain_name='', deferred_help=False, discovery_endpoint='', domain_id='', domain_name='', endpoint='', identity_provider='', insecure=None, interface='', key='', log_file=None, openid_scope='', os_beta_command=False, os_compute_api_version='', os_identity_api_version='', os_image_api_version='', os_network_api_version='', os_object_api_version='', os_project_id=None, os_project_name=None, os_volume_api_version='', passcode='', password='***', project_domain_id='', project_domain_name='', project_id='131b886b156a4f84b5f41baf2fbe646c', project_name='5633955729735406', protocol='', redirect_uri='', region_name='SBG1', timing=False, token=***'d291422655764f61a6232aaa1159f9fc', trust_id='', url=u'https://volume.compute.gra1.cloud.ovh.net/v2/131b886b156a4f84b5f41baf2fbe646c', user_domain_id='', user_domain_name='', user_id='', username='aeEayX6SzKe2', verbose_level=3, verify=None)
Auth plugin token_endpoint selected
auth_config_hook(): {'auth_type': 'token_endpoint', 'beta_command': False, u'compute_api_version': u'2', u'orchestration_api_version': u'1', u'database_api_version': u'1.0', 'cacert': None, 'auth_url': 'https://auth.cloud.ovh.net/v2.0', u'network_api_version': u'2', u'message': u'', u'image_format': u'qcow2', 'networks': [], u'image_api_version': u'2', 'verify': True, u'dns_api_version': u'2', u'object_store_api_version': u'1', 'username': 'aeEayX6SzKe2', 'verbose_level': 3, 'region_name': 'SBG1', 'api_timeout': None, u'baremetal_api_version': u'1', 'auth': {'project_name': '5633955729735406', 'token': 'd291422655764f61a6232aaa1159f9fc', 'project_id': '131b886b156a4f84b5f41baf2fbe646c'}, 'default_domain': 'default', 'debug': True, u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', 'key': None, 'timing': False, 'password': 'umXsVhPfJSrSrdMxNTerVZRC6fYZMudC', u'key_manager_api_version': u'v1', u'metering_api_version': u'2', 'deferred_help': False, u'identity_api_version': u'2.0', u'volume_api_version': u'2', 'url': u'https://volume.compute.gra1.cloud.ovh.net/v2/131b886b156a4f84b5f41baf2fbe646c', 'cert': None, u'secgroup_source': u'neutron', u'status': u'active', u'container_api_version': u'1', u'interface': None, u'disable_vendor_agent': {}}
defaults: {u'auth_type': 'token_endpoint', u'status': u'active', u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'api_timeout': None, u'baremetal_api_version': u'1', u'image_api_version': u'2', u'metering_api_version': u'2', u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', u'orchestration_api_version': u'1', 'cacert': None, u'network_api_version': u'2', u'message': u'', u'image_format': u'qcow2', u'key_manager_api_version': u'v1', 'verify': True, u'identity_api_version': u'2.0', u'volume_api_version': u'2', 'cert': None, u'secgroup_source': u'neutron', u'container_api_version': u'1', u'dns_api_version': u'2', u'object_store_api_version': u'1', u'interface': None, u'disable_vendor_agent': {}}
cloud cfg: {'auth_type': 'token_endpoint', 'beta_command': False, u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'timing': False, 'auth_url': 'https://auth.cloud.ovh.net/v2.0', u'network_api_version': u'2', u'message': u'', u'image_format': u'qcow2', 'networks': [], u'image_api_version': u'2', 'verify': True, u'dns_api_version': u'2', u'object_store_api_version': u'1', 'username': 'aeEayX6SzKe2', 'verbose_level': 3, 'region_name': 'SBG1', 'api_timeout': None, u'baremetal_api_version': u'1', 'auth': {'url': u'https://volume.compute.gra1.cloud.ovh.net/v2/131b886b156a4f84b5f41baf2fbe646c', 'project_id': '131b886b156a4f84b5f41baf2fbe646c', 'token': u'***', 'project_name': '5633955729735406'}, 'default_domain': 'default', u'container_api_version': u'1', u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', u'orchestration_api_version': u'1', 'cacert': None, 'password': '***', u'key_manager_api_version': u'v1', u'metering_api_version': u'2', 'deferred_help': False, u'identity_api_version': u'2.0', u'volume_api_version': u'2', 'url': u'https://volume.compute.gra1.cloud.ovh.net/v2/131b886b156a4f84b5f41baf2fbe646c', 'cert': None, u'secgroup_source': u'neutron', u'status': u'active', 'debug': True, u'interface': None, u'disable_vendor_agent': {}}
compute API version 2, cmd group openstack.compute.v2
network API version 2, cmd group openstack.network.v2
image API version 2, cmd group openstack.image.v2
volume API version 2, cmd group openstack.volume.v2
identity API version 2.0, cmd group openstack.identity.v2
object_store API version 1, cmd group openstack.object_store.v1
Auth plugin token_endpoint selected
auth_config_hook(): {'auth_type': 'token_endpoint', 'beta_command': False, u'compute_api_version': u'2', u'orchestration_api_version': u'1', u'database_api_version': u'1.0', 'cacert': None, 'auth_url': 'https://auth.cloud.ovh.net/v2.0', u'network_api_version': u'2', u'message': u'', u'image_format': u'qcow2', 'networks': [], u'image_api_version': u'2', 'verify': True, u'dns_api_version': u'2', u'object_store_api_version': u'1', 'username': 'aeEayX6SzKe2', 'verbose_level': 3, 'region_name': 'SBG1', 'api_timeout': None, u'baremetal_api_version': u'1', 'auth': {'project_name': '5633955729735406', 'token': 'd291422655764f61a6232aaa1159f9fc', 'project_id': '131b886b156a4f84b5f41baf2fbe646c'}, 'default_domain': 'default', 'debug': True, u'image_api_use_tasks': False, u'floating_ip_source': u'neutron', 'key': None, 'timing': False, 'password': 'umXsVhPfJSrSrdMxNTerVZRC6fYZMudC', u'key_manager_api_version': u'v1', u'metering_api_version': u'2', 'deferred_help': False, u'identity_api_version': u'2.0', u'volume_api_version': u'2', 'url': u'https://volume.compute.gra1.cloud.ovh.net/v2/131b886b156a4f84b5f41baf2fbe646c', 'cert': None, u'secgroup_source': u'neutron', u'status': u'active', u'container_api_version': u'1', u'interface': None, u'disable_vendor_agent': {}}
command: volume create -> openstackclient.volume.v2.volume.CreateVolume
Using auth plugin: token_endpoint
Using parameters {'url': u'https://volume.compute.gra1.cloud.ovh.net/v2/131b886b156a4f84b5f41baf2fbe646c', 'project_id': '131b886b156a4f84b5f41baf2fbe646c', 'token': '***', 'project_name': '5633955729735406'}
Get auth_ref
run(Namespace(availability_zone=None, columns=[], description=None, formatter=u'json', image=None, max_width=0, name=u'abc', noindent=False, prefix='', project=None, property={u'ownedby': u'167.114.246.75'}, size=1, snapshot=None, source=None, type=None, user=None, variables=[]))
Instantiating identity client: <class 'openstackclient.identity.client.IdentityClientv2'>
Instantiating volume client: <class 'cinderclient.v2.client.Client'>
Instantiating image client: <class 'glanceclient.v2.client.Client'>
Get auth_ref
invalid literal for float(): 2/131b886b156a4f84b5f41baf2fbe646c
Traceback (most recent call last):
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/cliff/app.py", line 387, in run_subcommand
    result = cmd.run(parsed_args)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/cliff/display.py", line 100, in run
    column_names, data = self.take_action(parsed_args)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/openstackclient/volume/v2/volume.py", line 102, in take_action
    image_client = self.app.client_manager.image
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/osc_lib/clientmanager.py", line 48, in __get__
    self._handle = self.factory(instance)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/openstackclient/image/client.py", line 58, in make_client
    insecure=not instance.verify,
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/glanceclient/v2/client.py", line 41, in __init__
    endpoint, self.version = utils.endpoint_version_from_url(endpoint, 2.0)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/glanceclient/common/utils.py", line 452, in endpoint_version_from_url
    endpoint, version = strip_version(endpoint)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/glanceclient/common/utils.py", line 391, in strip_version
    version = float(path.lstrip('v'))
ValueError: invalid literal for float(): 2/131b886b156a4f84b5f41baf2fbe646c
clean_up CreateVolume: invalid literal for float(): 2/131b886b156a4f84b5f41baf2fbe646c
Traceback (most recent call last):
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/osc_lib/shell.py", line 135, in run
    ret_val = super(OpenStackShell, self).run(argv)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/cliff/app.py", line 267, in run
    result = self.run_subcommand(remainder)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/osc_lib/shell.py", line 180, in run_subcommand
    ret_value = super(OpenStackShell, self).run_subcommand(argv)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/cliff/app.py", line 387, in run_subcommand
    result = cmd.run(parsed_args)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/cliff/display.py", line 100, in run
    column_names, data = self.take_action(parsed_args)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/openstackclient/volume/v2/volume.py", line 102, in take_action
    image_client = self.app.client_manager.image
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/osc_lib/clientmanager.py", line 48, in __get__
    self._handle = self.factory(instance)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/openstackclient/image/client.py", line 58, in make_client
    insecure=not instance.verify,
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/glanceclient/v2/client.py", line 41, in __init__
    endpoint, self.version = utils.endpoint_version_from_url(endpoint, 2.0)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/glanceclient/common/utils.py", line 452, in endpoint_version_from_url
    endpoint, version = strip_version(endpoint)
  File "/home/loic/software/ceph/ceph-workbench/virtualenv/local/lib/python2.7/site-packages/glanceclient/common/utils.py", line 391, in strip_version
    version = float(path.lstrip('v'))
ValueError: invalid literal for float(): 2/131b886b156a4f84b5f41baf2fbe646c

END return value: 1

Revision history for this message
Steve Martinelli (stevemar) wrote :

ouch looks like it chopped the url in the wrong spot, and picked up "2/" from the URL as part of the project id (131b886b156a4f84b5f41baf2fbe646c)

no longer affects: python-glanceclient
Revision history for this message
Steve Martinelli (stevemar) wrote :

another thing to note is that glanceclient blows up upon instantiation, guessing it'll happen for any osc command where the URL is that form.

Revision history for this message
Loic Dachary (dachary) wrote :

@Steve, thanks for the quick feedback :-) What puzzles me is that since this command needs both image and compute endpoints, can it even work ? There is a single OS_URL. Am I missing something here ?

Revision history for this message
Dean Troyer (dtroyer) wrote :

This is one place token_endpoint simply is not going to work. It was meant for bootstrapping the service catalog and we have no plans to expand it at this point.

You should look in to auth-type admin_token, it takes the token and an auth-url (same as other plugins) so a service catalog is available to the libraries. I have not tested this but it is the only method we would try to support for token auth to multiple endpoints.

Changed in python-openstackclient:
status: New → Won't Fix
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.