Comment 3 for bug 1441922

Revision history for this message
Jin Liu (jin-t) wrote : Re: Cinder volume command with keystone V3 authentication return BadRequest: Malformed request url

When run "openstack server list", I got similar ERROR. There's also project_id check in nova/api/openstack/wsgi.py function _process_stack().

Error log is as below,

# openstack --debug server list
DEBUG: openstackclient.shell compute API version 2, cmd group openstack.compute.v2
DEBUG: openstackclient.shell network API version 2, cmd group openstack.network.v2
DEBUG: openstackclient.shell image API version 1, cmd group openstack.image.v1
DEBUG: openstackclient.shell volume API version 1, cmd group openstack.volume.v1
DEBUG: openstackclient.shell identity API version 3, cmd group openstack.identity.v3
DEBUG: openstackclient.shell object_store API version 1, cmd group openstack.object_store.v1
DEBUG: stevedore.extension found extension EntryPoint.parse('table = cliff.formatters.table:TableFormatter')
DEBUG: stevedore.extension found extension EntryPoint.parse('csv = cliff.formatters.commaseparated:CSVLister')
DEBUG: openstackclient.shell prepare_to_run_command ListServer
DEBUG: openstackclient.shell validating authentication options
DEBUG: openstackclient.identity.client Instantiating identity client: <class 'keystoneclient.v3.client.Client'>
DEBUG: openstackclient.identity.client Using password auth
DEBUG: keystoneclient.auth.identity.v3 Making authentication request to http://**.**.**.**:35357/v3/auth/tokens
INFO: requests.packages.urllib3.connectionpool Starting new HTTP connection (1): **.**.**.**
DEBUG: requests.packages.urllib3.connectionpool "POST /v3/auth/tokens HTTP/1.1" 201 4444
DEBUG: openstackclient.compute.v2.server.ListServer take_action(Namespace(all_projects=False, columns=[], flavor=None, formatter='table', host=None, image=None, instance_name=None, ip=None, ip6=None, long=False, max_width=0, name=None, quote_mode='nonnumeric', reservation_id=None, status=None))
DEBUG: openstackclient.compute.client Instantiating compute client: <class 'novaclient.v1_1.client.Client'>
DEBUG: openstackclient.compute.v2.server.ListServer search options: {'instance_name': None, 'status': None, 'host': None, 'ip6': None, 'name': None, 'ip': None, 'flavor': None, 'reservation_id': None, 'image': None, 'all_tenants': False}
REQ: curl -i 'http://**.**.**.**:8774/v2/b5167e1a791d4cd8af0855603f73b9a0/servers/detail' -X GET -H "Accept: application/json" -H "User-Agent: python-novaclient" -H "X-Auth-Token: {SHA1}03aa4227ca578761f60664e623f490be33a79ff9"
RESP: [400] {'date': 'Fri, 10 Apr 2015 17:09:20 GMT', 'content-length': '160', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-c4ab0444-21f0-49a4-8223-dce1b9d22a1e'}
RESP BODY: null

ERROR: openstack Malformed request URL: URL's project_id 'b5167e1a791d4cd8af0855603f73b9a0' doesn't match Context's project_id 'None' (HTTP 400) (Request-ID: req-c4ab0444-21f0-49a4-8223-dce1b9d22a1e)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 280, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/display.py", line 91, in run
    column_names, data = self.take_action(parsed_args)
  File "/usr/lib/python2.7/site-packages/openstackclient/compute/v2/server.py", line 579, in take_action
    data = compute_client.servers.list(search_opts=search_opts)
  File "/usr/lib/python2.7/site-packages/novaclient/v1_1/servers.py", line 603, in list
    return self._list("/servers%s%s" % (detail, query_string), "servers")
  File "/usr/lib/python2.7/site-packages/novaclient/base.py", line 67, in _list
    _resp, body = self.api.client.get(url)
  File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 487, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 465, in _cs_request
    resp, body = self._time_request(url, method, **kwargs)
  File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 439, in _time_request
    resp, body = self.request(url, method, **kwargs)
  File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 433, in request
    raise exceptions.from_response(resp, body, url, method)
BadRequest: Malformed request URL: URL's project_id 'b5167e1a791d4cd8af0855603f73b9a0' doesn't match Context's project_id 'None' (HTTP 400) (Request-ID: req-c4ab0444-21f0-49a4-8223-dce1b9d22a1e)