New Question
0

Gnocchi - Keystone Unable to Validate Token

asked 2017-10-27 07:48:19 +0200

awestin1 gravatar image

updated 2017-10-27 07:51:36 +0200

I am trying to set up Ceilometer with Gnocchi. Gnocchi has been installed and configured. However, after starting the Gnocchi api and metricd, I keep getting an error when attempting to test Gnicchi. When I run gnocchi metric list, I get the following error:

[~]# gnocchi metric list
{"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"} (HTTP 503)

At the same time, I get the following error from /etc/var/log/gnocchi/gnocchi.log:

2017-10-27 00:32:27.241 3231 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
2017-10-27 00:32:27.242 3231 CRITICAL keystonemiddleware.auth_token [-] Unable to validate token: Identity server rejected authorization necessary to fetch token data

I also get the following from stderr on gnocchi-api:

[~]# gnocchi-api -p 8041 -b 0.0.0.0
Option "verbose" from group "DEFAULT" is deprecated for removal.  Its value may be silently ignored in the future.
********************************************************************************
STARTING test server gnocchi.rest.app.build_wsgi_app
Available at http://gcp-openstack:8041/
DANGER! For testing only, do not use in production
********************************************************************************
10.9.47.55 - - [26/Oct/2017 23:32:21] "GET /v1/metric HTTP/1.1" 503 170

The [keystone_authtoken] section in my /etc/gnocchi/gnocchi.conf is as follows:

[keystone_authtoken]
auth_type = password
auth_url = http://controller:5000/v3
project_domain_name = Default
user_domain_name = Default
project_name = service
username = gnocchi
password = P@ssw0rd
interface = internalURL
region_name = RegionOne

Does anyone have any suggestions for troubleshooting this issue? I have already sourced admin-openrc before running the Gnocchi client. So, I am not sure why I am receiving this message. My admin-openrc is as follows:

[~]# cat admin-openrc 
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=admin_P@ssw0rd
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
export OS_AUTH_TYPE=password

Are there any other environment variables I am supposed to be setting?

Edit: I am running Ocata RDO on RHEL 7.

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted
0

answered 2018-01-30 04:20:45 +0200

awestin1 gravatar image

updated 2018-01-30 04:24:31 +0200

It turns out that there were actually a few issues.

1) Apparently, Gnocchi doesn't like you having admin creds loaded for the environment variables (which I was using per above in admin-openrc) when running the Gnocchi client. Instead use something like this to load your Gnochi creds:

[ ~] # cat ./gnocchi-openrc
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=service
export OS_USERNAME=gnocchi
export OS_PASSWORD=GNOCCHI_PW
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
export OS_AUTH_TYPE=password

2) The RDO documentation for Ocata Gnocchi install skipped adding necessary permissions/role need to be assigned to the gnocchi user in keystone and I didn't notice. I added the role/permissions:

[ ~]# openstack role add --project service --user gnocchi admin

3) Lastly, I was running the latest version of Gnocchi at the time (4.0.3) and Ceilometer 8.1.1. According to the following bug report, it appears support for explicitly setting interface/regoin_name was changed in gnocchiclient 3.1 and remove in gnocchiclient 4:

https://bugs.launchpad.net/ceilometer... https://bugs.launchpad.net/ceilometer...

Per the bug report (above), Gnocchi support broke in Gnocchi 3.1. The latest available version PyPi before 3.1 is 3.0.15. I uninstalled 4.0.3 and installed 3.0.15. However, I ran into the following error when trying to run ceilometer-upgrade:

[~] # ceilometer-upgrade --skip-metering-database
2017-11-14 17:20:33.073 147323 WARNING oslo_reports.guru_meditation_report [-] Guru meditation now registers SIGUSR1 and SIGUSR2 by default for backward compatibility. SIGUSR1 will no longer be registered in a future release, so please use SIGUSR2 to generate reports.
2017-11-14 17:20:33.073 147323 INFO ceilometer.cmd.storage [-] Skipping metering database upgrade
2017-11-14 17:20:33.074 147323 DEBUG ceilometer.cmd.storage [-] Upgrading Gnocchi resource types upgrade /usr/lib/python2.7/site-packages/ceilometer/cmd/storage.py:51
2017-11-14 17:20:33.392 147323 CRITICAL ceilometer [-] Unhandled error: ResourceNotFound: Resource type ceph_account does not exist (HTTP 404)
2017-11-14 17:20:33.392 147323 ERROR ceilometer Traceback (most recent call last):
2017-11-14 17:20:33.392 147323 ERROR ceilometer File "/bin/ceilometer-upgrade", line 10, in <module>
2017-11-14 17:20:33.392 147323 ERROR ceilometer sys.exit(upgrade())
2017-11-14 17:20:33.392 147323 ERROR ceilometer File "/usr/lib/python2.7/site-packages/ceilometer/cmd/storage.py", line 53, in upgrade
2017-11-14 17:20:33.392 147323 ERROR ceilometer gnocchi_client.upgrade_resource_types(conf)
2017-11-14 17:20:33.392 147323 ERROR ceilometer File "/usr/lib/python2.7/site-packages/ceilometer/gnocchi_client.py", line 113, in upgrade_resource_types
2017-11-14 17:20:33.392 147323 ERROR ceilometer gnocchi.resource_type.get(name=name)
2017-11-14 17:20:33.392 147323 ERROR ceilometer File "/usr/lib/python2.7/site-packages/gnocchiclient/v1/resource_type.py", line 44, in get
2017-11-14 17:20:33.392 147323 ERROR ceilometer headers={'Content-Type': "application/json"}).json()
2017-11-14 17:20:33.392 147323 ERROR ceilometer File "/usr/lib/python2.7/site-packages/gnocchiclient/v1/base.py", line 37, in _get
2017-11-14 17:20:33.392 147323 ERROR ceilometer return self.client.api.get(*args, **kwargs)
2017-11-14 ...
(more)
edit flag offensive delete link more

Comments

Thanks for posting the solution, it will be helpful for other people in the future. :) Also, just an FYI, it's a good thing you've switched to Gnocchi, the Ceilometer API has been deprecated for a while, and no longer available in Queens. The ceilometer-polling will publish to Gnocchi by default.

Claudiu Belu gravatar imageClaudiu Belu ( 2018-02-23 16:55:54 +0200 )edit
0

answered 2017-10-27 11:08:14 +0200

alexpilotti gravatar image

Hi, since this is a generic question on Gnocchi, I'd recommend to post it on https://ask.openstack.org

edit flag offensive delete link more
0

answered 2017-10-27 08:52:29 +0200

eimazas gravatar image

I had similiar issue. The problem was that i couldn't be authenticated through https (SSL). I needed to change servers interface MTU to 1500

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-10-27 07:48:19 +0200

Seen: 6,353 times

Last updated: Jan 30 '18