报错信息
ClientException: Unknown Error (HTTP 503) (Request-ID: req-c9ec29c6-cca5-4edc-9828-cd6494d2d36b)
ERROR (ClientException): Unknown Error (HTTP 503) (Request-ID: req-c9ec29c6-cca5-4edc-9828-cd6494d2d36b)
使用debug调试查看报错信息:
nova --debug list
DEBUG (extension:157) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token')
DEBUG (extension:157) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken')
DEBUG (extension:157) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode')
DEBUG (extension:157) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password')
DEBUG (extension:157) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password')
DEBUG (extension:157) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword')
DEBUG (extension:157) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token')
DEBUG (extension:157) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token')
DEBUG (extension:157) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password')
DEBUG (extension:157) found extension EntryPoint.parse('password-ceilometer-legacy = ceilometer.keystone_client:LegacyCeilometerKeystoneLoader')
DEBUG (extension:157) found extension EntryPoint.parse('gnocchi-noauth = gnocchiclient.noauth:GnocchiNoAuthLoader')
DEBUG (extension:157) found extension EntryPoint.parse('password-aodh-legacy = aodh.keystone_client:LegacyAodhKeystoneLoader')
DEBUG (session:248) REQ: curl -g -i -X GET http://xiandian:35357/v3 -H "Accept: application/json" -H "User-Agent: keystoneauth1/2.4.1 python-requests/2.10.0 CPython/2.7.5"
INFO (connectionpool:213) Starting new HTTP connection (1): xiandian
DEBUG (connectionpool:395) "GET /v3 HTTP/1.1" 200 248
DEBUG (session:277) RESP: [200] Date: Mon, 15 Apr 2019 21:20:09 GMT Server: Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5 Vary: X-Auth-Token x-openstack-request-id: req-3880cf1c-1b66-4979-8f4f-97f124c3309a Content-Length: 248 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: application/json
RESP BODY: {"version": {"status": "stable", "updated": "2016-04-04T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.6", "links": [{"href": "http://xiandian:35357/v3/", "rel": "self"}]}}
DEBUG (base:165) Making authentication request to http://xiandian:35357/v3/auth/tokens
DEBUG (connectionpool:395) "POST /v3/auth/tokens HTTP/1.1" 201 7023
DEBUG (session:248) REQ: curl -g -i -X GET http://xiandian:8774/v2.1/0ab2dbde4f754b699e22461426cd0774 -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}7bb47d571e5919ede7d56311cdcbff92b2836852"
INFO (connectionpool:213) Starting new HTTP connection (1): xiandian
DEBUG (connectionpool:395) "GET /v2.1/0ab2dbde4f754b699e22461426cd0774 HTTP/1.1" 503 100
DEBUG (session:277) RESP: [503] Content-Length: 100 Content-Type: text/plain; charset=UTF-8 X-Compute-Request-Id: req-c9ec29c6-cca5-4edc-9828-cd6494d2d36b Date: Mon, 15 Apr 2019 21:20:10 GMT Connection: keep-alive
RESP BODY: 503 Service Unavailable**
The server is currently unavailable. Please try again at a later time.
DEBUG (shell:1082) Unknown Error (HTTP 503) (Request-ID: req-c9ec29c6-cca5-4edc-9828-cd6494d2d36b)
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/novaclient/shell.py", line 1080, in main
OpenStackComputeShell().main(argv)
File "/usr/lib/python2.7/site-packages/novaclient/shell.py", line 914, in main
api_version = api_versions.discover_version(self.cs, api_version)
File "/usr/lib/python2.7/site-packages/novaclient/api_versions.py", line 267, in discover_version
client)
File "/usr/lib/python2.7/site-packages/novaclient/api_versions.py", line 248, in _get_server_version_range
version = client.versions.get_current()
File "/usr/lib/python2.7/site-packages/novaclient/v2/versions.py", line 84, in get_current
return self._get_current()
File "/usr/lib/python2.7/site-packages/novaclient/v2/versions.py", line 57, in _get_current
return self._get(url, "version")
File "/usr/lib/python2.7/site-packages/novaclient/base.py", line 339, in _get
resp, body = self.api.client.get(url)
File "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 173, in get
return self.request(url, 'GET', **kwargs)
File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 94, in request
raise exceptions.from_response(resp, body, url, method)
ClientException: Unknown Error (HTTP 503) (Request-ID: req-c9ec29c6-cca5-4edc-9828-cd6494d2d36b)
ERROR (ClientException): Unknown Error (HTTP 503) (Request-ID: req-c9ec29c6-cca5-4edc-9828-cd6494d2d36b)
上面debug返回的信息大概就是向nova请求版本信息时出现了错误,返回503错误,去查看nova-api日志
2019-04-15 20:59:05.548 2053 CRITICAL keystonemiddleware.auth_token [-] Unable to validate token: Identity server rejected authorization necessary to fetch token data
2019-04-15 20:59:05.549 2053 INFO nova.osapi_compute.wsgi.server [-] 127.0.0.1 "GET /v2.1/20b1ab08ea644670addb52f6d2f2ed61/servers/detail?all_tenants=True HTTP/1.1" status: 503 len: 323 time: 0.1430879
2019-04-15 21:04:42.036 2052 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
2019-04-15 21:04:42.135 2052 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
2019-04-15 21:04:42.135 2052 CRITICAL keystonemiddleware.auth_token [-] Unable to validate token: Identity server rejected authorization necessary to fetch token data
2019-04-15 21:04:42.169 2052 INFO nova.osapi_compute.wsgi.server [-] 127.0.0.1 "GET /v2.1/0ab2dbde4f754b699e22461426cd0774 HTTP/1.1" status: 503 len: 323 time: 0.2380521
2019-04-15 21:04:46.165 2052 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
2019-04-15 21:04:46.270 2052 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
2019-04-15 21:04:46.270 2052 CRITICAL keystonemiddleware.auth_token [-] Unable to validate token: Identity server rejected authorization necessary to fetch token data
2019-04-15 21:04:46.280 2052 INFO nova.osapi_compute.wsgi.server [-] 127.0.0.1 "GET /v2.1/0ab2dbde4f754b699e22461426cd0774 HTTP/1.1" status: 503 len: 323 time: 0.2405150
2019-04-15 21:04:55.699 2052 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
2019-04-15 21:04:55.752 2052 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
2019-04-15 21:04:55.752 2052 CRITICAL keystonemiddleware.auth_token [-] Unable to validate token: Identity server rejected authorization necessary to fetch token data
2019-04-15 21:04:55.753 2052 INFO nova.osapi_compute.wsgi.server [-] 127.0.0.1 "GET /v2.1/0ab2dbde4f754b699e22461426cd0774 HTTP/1.1" status: 503 len: 323 time: 0.1294382
可以看到keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
nova在向keystone验证novaclient中携带的token时出现了“Unauthorized”未经授权错误,首先去查看nova.conf文件中的keystone_authtoken段的project_name、username和password是否有问题,如果确定没有问题,就尝试把nova用户的密码更改为nova配置文件你所填的密码保持一致
[keystone_authtoken]
slo_messaging_rabbit /
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = demo
user_domain_name = demo
project_name = service
username = nova
password = 000000
openstack user set --password 000000 nova
#nova-list去看一下有没有报错
nova list
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+
这样是没问题的.