ERROR: n/a (HTTP 400) when run nova

Asked by neo0

I use the official documents of Openstack to install Essex on Ubuntu 12.04 beta
My nova use keystone to auth, keystone service is worked well with glance, but nova command doesn't work.

# nova list
ERROR: n/a (HTTP 400)

I create an openrc file with content and

$ source openrc

export OS_USERNAME=adminUser
export OS_TENANT_NAME=openstackDemo
export OS_PASSWORD=secretword
export OS_AUTH_URL=http://172.17.2.203:5000/v2.0/
export OS_REGION_NAME=RegionOne

It works well with glance.

What's wrong in this case?
Thank you!

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Vish Ishaya
Solved:
Last query:
Last reply:
Revision history for this message
Vish Ishaya (vishvananda) said :
#1

Try:

nova --debug list

you should be able to see the url that is failing. Probably your endpoints are misconfigured and it is connecting to the wrong url.

Vish

Revision history for this message
neo0 (tungns-inf) said :
#2

Here the output of debug command:

connect: (172.17.2.203, 5000)
send: 'POST /v2.0/tokens HTTP/1.1\r\nHost: 172.17.2.203:5000\r\nContent-Length: 117\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": "openstackDemo", "passwordCredentials": {"username": "adminUser", "password": "secretword"}}}'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: application/json
header: Vary: X-Auth-Token
header: Date: Thu, 26 Apr 2012 02:28:44 GMT
header: Transfer-Encoding: chunked
connect: (172.17.2.203, 8774)
connect fail: (u'172.17.2.203', 8774)
DEBUG (shell:416) n/a (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 364, in main
    args.func(self.cs, args)
  File "/usr/lib/python2.7/dist-packages/novaclient/v1_1/shell.py", line 520, in do_list
    utils.print_list(cs.servers.list(search_opts=search_opts), columns,
  File "/usr/lib/python2.7/dist-packages/novaclient/v1_1/servers.py", line 279, in list
    return self._list("/servers%s%s" % (detail, query_string), "servers")
  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)
BadRequest: n/a (HTTP 400)
ERROR: n/a (HTTP 400)

It can not connect to host IP 172.17.2.203:8774 but here is the detail of my tokens. Is this look correct?

{
    "access": {
        "serviceCatalog": [
            {
                "endpoints": [
                    {
                        "adminURL": "http://172.17.2.203:8776/v1/735ffa39e5cd4b8b8f30414ce4dcc2cd",
                        "internalURL": "http://172.17.2.203:8776/v1/735ffa39e5cd4b8b8f30414ce4dcc2cd",
                        "publicURL": "http://172.17.2.203:8776/v1/735ffa39e5cd4b8b8f30414ce4dcc2cd",
                        "region": "RegionOne"
                    }
                ],
                "endpoints_links": [],
                "name": "volume",
                "type": "volume"
            },
            {
                "endpoints": [
                    {
                        "adminURL": "http://127.0.0.1:8080/",
                        "internalURL": "http://127.0.0.1:8080/v1/AUTH_735ffa39e5cd4b8b8f30414ce4dcc2cd",
                        "publicURL": "http://127.0.0.1:8080/v1/AUTH_735ffa39e5cd4b8b8f30414ce4dcc2cd",
                        "region": "RegionOne"
                    }
                ],
                "endpoints_links": [],
                "name": "swift",
                "type": "storage"
            },
            {
                "endpoints": [
                    {
                        "adminURL": "http://172.17.2.203:9292/v1",
                        "internalURL": "http://172.17.2.203:9292/v1",
                        "publicURL": "http://172.17.2.203:9292/v1",
                        "region": "RegionOne"
                    }
                ],
                "endpoints_links": [],
                "name": "glance",
                "type": "image"
            },
            {
                "endpoints": [
                    {
                        "adminURL": "http://172.17.2.203:8774/v2/735ffa39e5cd4b8b8f30414ce4dcc2cd",
                        "internalURL": "http://172.17.2.203:8774/v2/735ffa39e5cd4b8b8f30414ce4dcc2cd",
                        "publicURL": "http://172.17.2.203:8774/v2/735ffa39e5cd4b8b8f30414ce4dcc2cd",
                        "region": "RegionOne"
                    }
                ],
                "endpoints_links": [],
                "name": "nova",
                "type": "compute"
            },
            {
                "endpoints": [
                    {
                        "adminURL": "http://172.17.2.203:5000/v2.0",
                        "internalURL": "http://172.17.2.203:5000/v2.0",
                        "publicURL": "http://172.17.2.203:35357/v2.0",
                        "region": "RegionOne"
                    }
                ],
                "endpoints_links": [],
                "name": "keystone",
                "type": "identity"
            }
        ],
        "token": {
            "expires": "2012-04-27T02:26:02Z",
            "id": "987bea4f08274405adad8a361067b371",
            "tenant": {
                "description": "Service Tenant",
                "enabled": true,
                "id": "735ffa39e5cd4b8b8f30414ce4dcc2cd",
                "name": "service"
            }
        },
        "user": {
            "id": "c9c8c911c9f64eb1aad01b2792a99ce7",
            "name": "nova",
            "roles": [
                {
                    "id": "e7f1492647894b179fb1002894f8f497",
                    "name": "admin"
                }
            ],
            "roles_links": [],
            "username": "nova"
        }
    }
}

Revision history for this message
Hua Zhang (zhhuabj) said :
#3

here is my env, you can refer:

export OS_USERNAME=admin
export OS_PASSWORD=password
export SERVICE_ENDPOINT=http://localhost:35357/v2.0
export SERVICE_TOKEN=ADMIN

#for nova client
export NOVA_AUTH_STRATEGY=keystone
export NOVA_USERNAME=admin
export NOVA_PASSWORD=password
export NOVA_PROJECT_ID=admin
export NOVA_URL=http://localhost:35357/v2.0
export NOVA_VERSION=1.1

#for glance client
export OS_AUTH_USER=admin
export OS_AUTH_KEY=password
export OS_AUTH_TENANT=admin
export OS_AUTH_URL=http://localhost:35357/v2.0
export OS_AUTH_STRATEGY=keystone

Revision history for this message
Best Vish Ishaya (vishvananda) said :
#4

Yes, your problem seems to be that the ip is wrong or that nova-api is not running properly. The endpoint configuration seems to be correct.

Revision history for this message
neo0 (tungns-inf) said :
#5

The IP is correct. Maybe Ubuntu 12.04 beta doesn't complete so there're some errors. I will make a fresh install with the final version.
Thank for your help :)

Revision history for this message
neo0 (tungns-inf) said :
#6

Thanks Vish Ishaya, that solved my question.