Ask Your Question

Gnocchi API responses 401 Unauthorised

asked 2018-03-31 05:23:31 -0500

M.Pav gravatar image

updated 2018-04-04 16:26:05 -0500

I have prepaired Gnocchi by documentation at I am using Keystone, but I am not able to make a request.


GET http://<serverIP>:8041/v1/metric/0b5aa633-3ebf-49d5-99ad-e78302c41376 HTTP/1.1


date: Fri, 30 Mar 2018 20:24:26 GMT
server: Apache/2.4.18 (Ubuntu)
www-authenticate: Keystone uri=''
content-length: 114
connection: close
content-type: application/json

    "error": {
    "message": "The request you have made requires authentication.",
    "code": 401,
    "title": "Unauthorized"

I have OpenStack Queens installed by DevStack script on my Ubuntu 16.

I have only admin credentials, how can i get X-Auth-Token required? Or is the request bad?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-04-04 17:30:29 -0500

updated 2018-04-04 17:33:55 -0500

The easiest way to get a token is the command openstack token issue. Then you put that token into the x-auth-token header of you GET request to Gnocchi.

Getting a token via API is documented at the API guide.

edit flag offensive delete link more


Meanwhile, i installed version Pike instead Queens. But this answer really helped. Thanks.

M.Pav gravatar imageM.Pav ( 2018-04-05 11:08:04 -0500 )edit

The process to get a token is the same on Queens as any earlier OpenStack version (within reason).

There are, however, two Keystone API versions; the approach taken by v2 is much simpler than v3, but you are more likely to encounter v3, no matter which OpenStack version you have.

Bernd Bausch gravatar imageBernd Bausch ( 2018-04-05 22:58:07 -0500 )edit

Definitely use v3 if available. Not only is v2 going away, it suffers from some security issues...

edmondsw gravatar imageedmondsw ( 2018-04-06 08:38:03 -0500 )edit

I use the commandopenstack token issue, still repsonses 401 Unauthorised.Why! How can trouble shooting.

ohofanz gravatar imageohofanz ( 2018-04-26 04:53:22 -0500 )edit

I would start looking for errors in the Keystone and Gnocchi logs, and checking the Gnocchi authentication configuration. If you see nothing in the Keystone logs, your Gnocchi authentication config may reference an incorrect Keystone endpoint, and you should see relevant errors in the Gnocchi log.

Bernd Bausch gravatar imageBernd Bausch ( 2018-04-29 17:46:48 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2018-03-31 05:21:16 -0500

Seen: 999 times

Last updated: Apr 04 '18