[Openstack] [MONASCA] keystone version v3 switched to v2

범희대 heedae at solbox.com
Tue Nov 29 12:28:59 UTC 2016


Hello.
I'm very newby on openstack-monasca and today I once installed monas
ca api on a server as i learned the way through devstack page(http:/
/docs.openstack.org/developer/devstack/) and vagrant file (https://g
ithub.com/openstack/monasca-api/blob/master/devstack/Vagrantfile).
Then test monasca client just like the following.

1. generated user teampfmon and associate the role 'monasca-user' in
the project mini-mon
2. Once I tested monasca client with some options such as
    "monasca --os-username teampfmon --os-password solbox --os-user-
domain-name default --os-project-name mini-mon --os-auth-url http://
192.168.120.21:35357/v3 --os-service-type monitoring -d alarm-list"
   I got error result. It seemed that the version of keystone change
d in the progress from v3 to v2.0. could you, any one let me know ho
w to solve this problem? for your thought I'm posting the result of
monasca client and the api log.


   -----------< here is the command result >--------------------------

    DEBUG (base:189) Making authentication request to
http://192.168.120.21:35357/v3/auth/tokens
INFO (connectionpool:214) Starting new HTTP connection (1):
192.168.120.21
DEBUG (connectionpool:401) "POST /v3/auth/tokens HTTP/1.1" 201 1844
DEBUG (base:194) {"token": {"is_domain": false, "methods":
["password"], "roles": [{"id": "f649abe5389645c4a4ad52486cdc944b",
"name": "monasca-read-only-user"}, {"id":
"803be4a6fff44737bfba8d5bb786103a", "name": "service"},
{"id": "5bd32dadddd04863b00135a538bd7dfe", "name": "monasca-user"}],
"expires_at": "2016-11-29T12:36:07.000000Z", "project": {"domain":
{"id": "default", "name": "Default"}, "id":
"6a25a8121ac443129046ac66e9ec04fa", "name": "mini-mon"}, "catalog":
 [{"endpoints": [{"url": "http://192.168.120.21:8070/v2.0",
"interface": "internal", "region": "RegionOne",
"region_id": "RegionOne", "id": "0e70450c17584a0bb2b19aa6ac6a2877"},
 {"url": "http://192.168.120.21:8070/v2.0", "interface": "admin",
"region": "RegionOne", "region_id": "RegionOne", "id":
"89f121cafca94651857d58e8b77137bd"}, {"url":
"http://192.168.120.21:8070/v2.0", "interface": "public", "region":
"RegionOne", "region_id": "RegionOne", "id":
"8b292832b28e4dce94db8a2609cf602c"}], "type": "monitoring", "id":
"08d47fcce8ce4fcdb6d3440c501ce91c", "name": "monasca"},
{"endpoints": [{"url": "http://192.168.120.21/identity_admin",
"interface": "admin", "region": "RegionOne", "region_id":
"RegionOne", "id": "365aa10fd06c4714a30105ba9ecd1ec3"}, {"url":
"http://192.168.120.21/identity", "interface": "public", "region":
"RegionOne", "region_id": "RegionOne", "id":
"53151f8c14bf4877a1edeb9c59ce8ac6"}, {"url":
"http://192.168.120.21/identity", "interface": "internal",
"region": "RegionOne", "region_id": "RegionOne", "id":
"da0ed154dcda4a74bd365327f4deeadd"}], "type": "identity", "id":
"b8a91feb1e5b4c51b46f27f908789ed8", "name": "keystone"}], "user":
{"domain": {"id": "default", "name": "Default"},
"password_expires_at": null, "name": "teampfmon", "id":
"e4c428013d144091b95edcd768144588"}, "audit_ids":
["DyI6cfgNSPeT8Fe-2LX1rw"], "issued_at":
"2016-11-29T11:36:07.000000Z"}}
curl -i -X GET -H 'X-Auth-User: teampfmon'
-H 'X-Auth-Token: *****' -H 'X-Auth-Key: *****'
-H 'Accept: application/json'
-H 'User-Agent: python-monascaclient'
-H 'Content-Type: application/json'
-H 'X-Auth-Url: http://192.168.120.21:35357/v3'
http://192.168.120.21:8070/v2.0/alarms
DEBUG (http:156) curl -i -X GET -H 'X-Auth-User: teampfmon'
-H 'X-Auth-Token: *****' -H 'X-Auth-Key: *****'
-H 'Accept: application/json' -H 'User-Agent: python-monascaclient'
-H 'Content-Type: application/json'
-H 'X-Auth-Url: http://192.168.120.21:35357/v3'
http://192.168.120.21:8070/v2.0/alarms
INFO (connectionpool:214) Starting new HTTP connection (1):
192.168.120.21
DEBUG (connectionpool:401) "GET /v2.0/alarms HTTP/1.1" 503 170

HTTP/1.1 503 Service Unavailable
Server: gunicorn/19.6.0
Date: Tue, 29 Nov 2016 11:36:07 GMT
Connection: keep-alive
Content-Length: 170
Content-Type: application/json; charset=UTF-8

{"message": "The server is currently unavailable. Please try again
at a later time.<br /><br />\n\n\n", "code": "503 Service
Unavailable", "title": "Service Unavailable"}

DEBUG (http:169)
HTTP/1.1 503 Service Unavailable
Server: gunicorn/19.6.0
Date: Tue, 29 Nov 2016 11:36:07 GMT
Connection: keep-alive
Content-Length: 170
Content-Type: application/json; charset=UTF-8

{"message": "The server is currently unavailable. Please try again
at a later time.<br /><br />\n\n\n", "code": "503 Service
Unavailable", "title": "Service Unavailable"}

ERROR (exc:80) exception: {"message": "The server is currently
unavailable. Please try again at a later time.<br /><br />\n\n\n",
"code": "503 Service Unavailable", "title": "Service Unavailable"}
Traceback (most recent call last):
  File "/usr/local/bin/monasca", line 11, in <module>
    sys.exit(main())
  File
"/usr/local/lib/python2.7/dist-packages/monascaclient/shell.py",
line 443, in main
    MonascaShell().main(args)
  File
"/usr/local/lib/python2.7/dist-packages/monascaclient/shell.py",
line 398, in main
    args.func(client, args)
  File
"/usr/local/lib/python2.7/dist-packages/monascaclient/v2_0/sh
ell.py", line 1058, in do_alarm_list
    (he.code, he.message))
monascaclient.exc.CommandError: HTTPException code=503
message={"message": "The server is currently unavailable.
Please try again at a later time.<br /><br />\n\n\n",
"code": "503 Service Unavailable", "title": "Service Unavailable"}

--------------------------------------------------------------------
---------------------------------<here is the log>----------------------
[[D2016-11-29 20:36:07,762 DEBUG [gunicorn.error][GreenThread-1] GET
/v2.0/alarms
2016-11-29 20:36:07,763 WARNING
[keystonemiddleware.auth_token][GreenThread-1] Using the in-process
token cache is deprecated as of the 4.2.0 release and may be
removed in the 5.0.0 release or the 'O' development cycle. The
in-process cache causes inconsistent results and high memory usage.
When the feature is removed the auth_token middleware will not cache
 tokens by default which may result in performance issues. It is rec
ommended to use  memcache for the auth_token token cache by setting
the memcached_servers option.
2016-11-29 20:36:07,763 DEBUG [keystonemiddleware.auth_token][
GreenThread-1] Authenticating user token
2016-11-29 20:36:07,764 DEBUG [keystoneauth.session][GreenThread-1]
REQ: curl -g -i -X GET http://192.168.120.21:35357
-H "Accept: application/json" -H "User-Agent: monasca_api/0.0.0
keystonemiddleware.auth_token/4.10.0 keystoneauth1/2.15.0
python-requests/2.11.1 CPython/2.7.12"
2016-11-29 20:36:07,769 INFO [
requests.packages.urllib3.connectionpool][GreenThread-1]
Starting new HTTP connection (1): 192.168.120.21
2016-11-29 20:36:07,774 DEBUG [
requests.packages.urllib3.connectionpool][GreenThread-1]
"GET / HTTP/1.1" 300 621
2016-11-29 20:36:07,798 DEBUG [keystoneauth.session][GreenThread-1]
RESP: [300] Date: Tue, 29 Nov 2016 11:36:07 GMT Server:
Apache/2.4.18 (Ubuntu) Vary: X-Auth-Token Content-Length: 621
Keep-Alive: timeout=5, max=100 Connection: Keep-Alive
Content-Type: application/json
RESP BODY: {"versions": {"values": [{"status": "stable", "updated":
 "2016-10-06T00:00:00Z", "media-types": [{"base": "application/json"
"type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.7"
, "links": [{"href": "http://192.168.120.21/identity_admin/v3/",
"rel": "self"}]}, {"status": "deprecated", "updated":
"2016-08-04T00:00:00Z", "media-types": [{"base": "application/json",
 "type": "application/vnd.openstack.identity-v2.0+json"}], "id":
"v2.0", "links":
[{"href": "http://192.168.120.21/identity_admin/v2.0/", "rel":
"self"}, {"href": "http://docs.openstack.org/", "type": "text/html",
 "rel": "describedby"}]}]}}

2016-11-29 20:36:07,799 DEBUG [keystonemiddleware.auth_token]
[GreenThread-1] Auth Token confirmed use of None apis
2016-11-29 20:36:07,802 DEBUG [keystoneauth.identity.v2]
[GreenThread-1] Making authentication request to
http://192.168.120.21:35357/v2.0/tokens
2016-11-29 20:36:07,886 DEBUG
[requests.packages.urllib3.connectionpool][GreenThread-1]
"POST /v2.0/tokens HTTP/1.1" 401 114
2016-11-29 20:36:07,888 DEBUG [keystoneauth.session][GreenThread-1]
 Request returned failure status: 401
2016-11-29 20:36:07,888 INFO [keystonemiddleware.auth_token]
[GreenThread-1] Identity server rejected authorization
2016-11-29 20:36:07,889 WARNING [keystonemiddleware.auth_token]
[GreenThread-1] Identity response: {"error": {"message":
"The request you have made requires authentication.", "code": 401,
"title": "Unauthorized"}}
2016-11-29 20:36:07,889 INFO [keystonemiddleware.auth_token]
[GreenThread-1] Retrying validation
2016-11-29 20:36:07,890 DEBUG [keystoneauth.identity.v2]
[GreenThread-1] Making authentication request to
http://192.168.120.21:35357/v2.0/tokens
2016-11-29 20:36:07,964 DEBUG
[requests.packages.urllib3.connectionpool][GreenThread-1]
"POST /v2.0/tokens HTTP/1.1" 401 114
2016-11-29 20:36:07,966 DEBUG [keystoneauth.session][GreenThread-1]
Request returned failure status: 401
2016-11-29 20:36:07,966 INFO [keystonemiddleware.auth_token]
[GreenThread-1] Identity server rejected authorization
2016-11-29 20:36:07,967 WARNING [keystonemiddleware.auth_token]
[GreenThread-1] Identity response: {"error": {"message":
"The request you have made requires authentication.", "code": 401,
"title": "Unauthorized"}}
2016-11-29 20:36:07,967 CRITICAL [keystonemiddleware.auth_token]
[GreenThread-1] Unable to validate token: Identity server
rejected authorization necessary to fetch token data
2016-11-29 20:36:07,971 DEBUG [gunicorn.error][GreenThread-1]
Closing connection.

--------------------------------------------------------------------


Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20161129/554cccd9/attachment.html>


More information about the Openstack mailing list