Comment 6 for bug 996233

Revision history for this message
Paul Collins (pjdc) wrote :

Looking at William's trace, I see some differences with the traces I get. Not posting a full one in the first place was foolish of me. Here it is now.

$ nova --debug volume-list
connect: (XXX.XXX.XXX.XXX, 8774)
send: 'GET /v1.1 HTTP/1.1\r\nHost: XXX.XXX.XXX.XXX:8774\r\nx-auth-project-id: pjdc_project\r\naccept-encoding: gzip, deflate\r\nx-auth-user: pjdc\r\nuser-agent: python-novaclient\r\nx-auth-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\r\naccept: application/json\r\n\r\n'
reply: 'HTTP/1.1 204 No Content\r\n'
header: Content-Length: 0
header: X-Auth-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
header: X-Server-Management-Url: http://XXX.XXX.XXX.XXX:8774/v1.1/pjdc_project
header: Content-Type: text/plain; charset=UTF-8
header: Date: Thu, 31 May 2012 21:19:01 GMT
send: 'GET /v1.1/pjdc_project/volumes/detail HTTP/1.1\r\nHost: XXX.XXX.XXX.XXX:8774\r\nx-auth-project-id: pjdc_project\r\nx-auth-token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\naccept-encoding: gzip, deflate\r\naccept: application/json\r\nuser-agent: python-novaclient\r\n\r\n'
reply: 'HTTP/1.1 404 Not Found\r\n'
header: Content-Length: 52
header: Content-Type: text/plain; charset=UTF-8
header: Date: Thu, 31 May 2012 21:19:02 GMT
DEBUG (shell:416) n/a (HTTP 404)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/novaclient/shell.py", line 413, in main
    OpenStackComputeShell().main(sys.argv[1:])
  File "/usr/lib/python2.7/dist-packages/novaclient/shell.py", line 364, in main
    args.func(self.cs, args)
  File "/usr/lib/python2.7/dist-packages/novaclient/v1_1/shell.py", line 858, in do_volume_list
    volumes = cs.volumes.list()
  File "/usr/lib/python2.7/dist-packages/novaclient/v1_1/volumes.py", line 79, in list
    return self._list("/volumes/detail", "volumes")
  File "/usr/lib/python2.7/dist-packages/novaclient/base.py", line 71, in _list
    resp, body = self.api.client.get(url)
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 136, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 124, in _cs_request
    **kwargs)
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 107, in request
    raise exceptions.from_response(resp, body)
NotFound: n/a (HTTP 404)
ERROR: n/a (HTTP 404)

Whereas in William's trace the token is obtained with "POST /v2.0/tokens" and the list operation is performed with "GET /v1/5c9e830827e0412b92da25b128f5c63d/volumes/detail".

In the credentials packets we distribute to our Openstack users, we have a file containing environment variables, which includes:

export NOVA_URL="http://XXX.XXX.XXX.XXX:8774/v1.1/"
export NOVA_VERSION="1.1"

However, when I set things up as follows:

export NOVA_URL="http://XXX.XXX.XXX.XXX:8774/v2.0/"
export NOVA_VERSION="2"

I get:

$ nova --debug volume-list
connect: (XXX.XXX.XXX.XXX, 8774)
send: 'POST /v2.0/tokens HTTP/1.1\r\nHost: XXX.XXX.XXX.XXX:8774\r\nContent-Length: 137\r\ncontent-type: application/json\r\naccept-encoding: gzip, deflate\r\naccept: application/json\r\nuser-agent: python-novaclient\r\n\r\n{"auth": {"tenantName": "pjdc_project", "passwordCredentials": {"username": "pjdc", "password": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}}}'
reply: 'HTTP/1.1 400 Bad Request\r\n'
header: Content-Length: 141
header: Content-Type: application/json; charset=UTF-8
header: Date: Thu, 31 May 2012 21:26:01 GMT
DEBUG (shell:416) The server could not comply with the request since it is either malformed or otherwise incorrect. (HTTP 400)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/novaclient/shell.py", line 413, in main
    OpenStackComputeShell().main(sys.argv[1:])
  File "/usr/lib/python2.7/dist-packages/novaclient/shell.py", line 358, in main
    self.cs.authenticate()
  File "/usr/lib/python2.7/dist-packages/novaclient/v1_1/client.py", line 106, in authenticate
    self.client.authenticate()
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 229, in authenticate
    auth_url = self._v2_auth(auth_url)
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 284, in _v2_auth
    self._authenticate(url, body)
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 305, in _authenticate
    resp, body = self.request(token_url, "POST", body=body)
  File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 107, in request
    raise exceptions.from_response(resp, body)
BadRequest: The server could not comply with the request since it is either malformed or otherwise incorrect. (HTTP 400)
ERROR: The server could not comply with the request since it is either malformed or otherwise incorrect. (HTTP 400)

Which seems to leave us with

=== the v1.1 issue ===

When using the v1.1 API, novaclient is not able to query Openstack for a list of volumes. Is this supposed to be supported?

=== the v2 issue ===

The Openstack installation I'm testing against doesn't like the v2 API. In nova-api.log I find:

2012-05-31 21:26:01 INFO nova.api.openstack.wsgi [-] POST http://XXX.XXX.XXX.XXX:8774/v2.0/tokens
2012-05-31 21:26:01 ERROR nova.api.openstack.wsgi [-] Exception handling resource: multi() got an unexpected keyword argument 'body'
2012-05-31 21:26:01 TRACE nova.api.openstack.wsgi Traceback (most recent call last):
2012-05-31 21:26:01 TRACE nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 851, in _process_stack
2012-05-31 21:26:01 TRACE nova.api.openstack.wsgi action_result = self.dispatch(meth, request, action_args)
2012-05-31 21:26:01 TRACE nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 926, in dispatch
2012-05-31 21:26:01 TRACE nova.api.openstack.wsgi return method(req=request, **action_args)
2012-05-31 21:26:01 TRACE nova.api.openstack.wsgi TypeError: multi() got an unexpected keyword argument 'body'
2012-05-31 21:26:01 TRACE nova.api.openstack.wsgi
2012-05-31 21:26:01 INFO nova.api.openstack.wsgi [-] http://XXX.XXX.XXX.XXX:8774/v2.0/tokens returned with HTTP 400

I'll look into this, but if someone recognizes the symptom or has any ideas, that would be very helpful.