分享

nova 取不到token问题求助

skymoou 发表于 2016-5-13 16:21:09 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 4 25312
部署nova后[root@localhost ~]# openstack host list
Unknown Error (HTTP 503) (Request-ID: req-3dcca84e-1064-40f9-86fb-cc5123cbb1d0)


查看日志发现是token无法取到导致


2016-05-13 15:59:24.014 7413 DEBUG nova.osapi_compute.wsgi.server [-] (7413) accepted ('192.168.1.69', 58744) server /usr/lib/python2.7/site-packages/eventlet/wsgi.py:826
2016-05-13 15:59:24.020 7413 DEBUG keystoneclient.session [-] REQ: curl -g -i -X GET http://127.0.0.1:35357 -H "Accept: application/json" -H "User-Agent: nova/12.0.1 keystonemiddleware.auth_token/2.3.1" _http_log_request /usr/lib/python2.7/site-packages/keystoneclient/session.py:198
2016-05-13 15:59:24.045 7413 DEBUG keystoneclient.session [-] RESP: [300] Content-Length: 589 Vary: X-Auth-Token Keep-Alive: timeout=5, max=100 Server: Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5 Connection: Keep-Alive Date: Fri, 13 May 2016 07:59:24 GMT Content-Type: application/json
RESP BODY: {"versions": {"values": [{"status": "stable", "updated": "2015-03-30T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.4", "links": [{"href": "http://127.0.0.1:35357/v3/", "rel": "self"}]}, {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://127.0.0.1:35357/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}]}}
_http_log_response /usr/lib/python2.7/site-packages/keystoneclient/session.py:215
2016-05-13 15:59:24.047 7413 DEBUG keystoneclient.auth.identity.v2 [-] Making authentication request to http://127.0.0.1:35357/v2.0/tokens get_auth_ref /usr/lib/python2.7/site-packages/keystoneclient/auth/identity/v2.py:86
2016-05-13 15:59:24.053 7413 DEBUG keystoneclient.session [-] Request returned failure status: 400 request /usr/lib/python2.7/site-packages/keystoneclient/session.py:400
2016-05-13 15:59:24.053 7413 ERROR keystonemiddleware.auth_token [-] Bad response code while validating token: 400
2016-05-13 15:59:24.053 7413 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "Expecting to find username or userId in passwordCredentials - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error.", "code": 400, "title": "Bad Request"}}
2016-05-13 15:59:24.054 7413 CRITICAL keystonemiddleware.auth_token [-] Unable to validate token: Failed to fetch token data from identity server
2016-05-13 15:59:24.055 7413 INFO nova.osapi_compute.wsgi.server [-] 192.168.1.69 "GET /v2/083d0ed1647148479c54aa8d4959302e/os-hosts HTTP/1.1" status: 503 len: 323 time: 0.0377760






但是单独执行的时候可以取到token
[root@localhost ~]#  curl -X POST http://127.0.0.1:35357/v2.0/tokens  -d '{"auth":{"passwordCredentials":{"username":"nova", "password":"nova"}}}' -H"Content-type: application/json"

{"access": {"token": {"issued_at": "2016-05-13T08:01:03.701957", "expires": "2016-05-13T09:01:03Z", "id": "18986af5919148f8a0fcc154ccbf9493", "audit_ids": ["2lYf25sNS1erlWp8lYn5mw"]}, "serviceCatalog": [], "user": {"username": "nova", "roles_links": [], "id": "696ae1b1c335498ba64e70454fad5441", "roles": [], "name": "nova"}, "metadata": {"is_admin": 0, "roles": []}}}


想请问一下这个是什么原因导致,万分感谢


已有(4)人评论

跳转到指定楼层
bioger_hit 发表于 2016-5-13 22:19:36
本帖最后由 bioger_hit 于 2016-5-13 22:21 编辑

"2016-05-13T08:01:03.701957", "expires": "2016-05-13T09:01:03Z"翻译:
"2016-05-13T08:01:03.701957", "到期": "2016-05-13T09:01:03Z"
早上9点就过期了。
楼主是下午3点用的
2016-05-13 15:59:24.014 7413 DEBUG nova.osapi_compute.wsgi.server [-] (7413) accepted ('192.168.1.69', 58744) server /usr/lib/python2.7/site-packages/eventlet/wsgi.py:826
2016-05-13 15:59:24.020

虽然还有,但是已经失效了
重新生成token一下

回复

使用道具 举报

skymoou 发表于 2016-5-17 13:23:11
bioger_hit 发表于 2016-5-13 22:19
"2016-05-13T08:01:03.701957", "expires": "2016-05-13T09:01:03Z"翻译:
"2016-05-13T08:01:03.701957", ...

不好意思现在才回复您,谢谢的你的提醒,我重新再试一下
回复

使用道具 举报

skymoou 发表于 2016-5-18 09:45:27
bioger_hit 发表于 2016-5-13 22:19
"2016-05-13T08:01:03.701957", "expires": "2016-05-13T09:01:03Z"翻译:
"2016-05-13T08:01:03.701957", ...

是试了一下不是这原因导致的,是我配置文件错误的原因导致的,我把本应该在各个模块下的配置,都写到了一个模块下。
回复

使用道具 举报

h3hlh18 发表于 2017-7-14 16:50:11
skymoou 发表于 2016-5-18 09:45
是试了一下不是这原因导致的,是我配置文件错误的原因导致的,我把本应该在各个模块下的配置,都写到了一 ...

我也出这个错了,请问楼主,是哪个配置文件写的有问题?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条