gnocchi: Cannot read resources and etc. whilst using auth_mode as keystone or noauth
I’m planning to send all metrics collected by gnocchi to graph - grafana.
Metrics are sent and collected to and by gnocchi, and ceilometer - telemetry - is doing the job. I only can list metrics and resources in basic mode. In noauth mode, it shows me empty - or sometimes 403 -, and in keystone mode it comes up with either the following result :
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at
root@localhost to inform them of the time this error occurred,
and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
</body></html>
(HTTP 500)
or the following ( when noauth is 403 ) :
The request you have made requires authentication. (HTTP 401)
I ran tcpdump, and all of three methods are sending one thing - shown below - but getting different results:
Host: localhost:8041
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: application/json, */*
User-Agent: gnocchi keystoneauth1/2.20.0 python-requests/2.10.0 CPython/2.7.5
Authorization: basic YWRtaW46
Gnocchi, Ceilometer and Keystone are configured as shown below, I just sometimes play with domain and ip addresses, but everything is setup on one host :
Gnocchi
[DEFAULT]
debug = true
verbose = true
[api]
workers = 4
paste_config = /usr/lib/python2.7/site-packages/gnocchi/rest/api-paste.ini
auth_mode = keystone
[cors]
allowed_origin = *
allow_credentials = false
[database]
backend = sqlalchemy
[indexer]
url = "postgresql://gnocchi:gnocchi@127.0.0.1/gnocchi"
[metricd]
workers = 8
[statsd]
host = 0.0.0.0
port = 8125
[storage]
driver = file
file_basepath = /var/lib/gnocchi
[keystone_authtoken]
auth_type = password
auth_uri = http://127.0.0.1:5000/v3
auth_uri = http://127.0.0.1:35357
memcached_servers = http://127.0.0.1:11211
project_domain_name = default
user_domain_name = default
project_name = service
username = gnocchi
password = gnocchi
interface = internalURL
region_name = RegionX
Ceilometer
[DEFAULT]
transport_url = rabbit://openstack:m9943mD7ZKpmNqAV4bbfJTQAtP8bt7gV@127.0.0.1
meter_dispatchers=gnocchi
event_dispatchers=gnocchi
[api]
gnocchi_is_enabled = true
[dispatcher_gnocchi]
filter_service_activity = False
archive_policy = low
filter_project = gnocchi
url = http://127.0.0.1:8041
auth_section = service_credentials_gnocchi
resources_definition_file = gnocchi_resources.yaml
[ipmi]
token_cache_time = -1
#whilst using noauth:
[service_credentials_gnocchi]
auth_type=gnocchi-noauth
roles = admin
user_id = a4229d64a35a4886abe50af025190d8f
project_id = dee5750a9d534f79aafdeb2074ae0369
endpoint = http://127.0.0.1:8041
[service_credentials]
auth_url = http://127.0.0.1:5000/v3
project_domain_id = default
user_domain_id = default
auth_type = password
username = ceilometer
project_name = service
password = 123456
interface = internalURL
region_name = Region_LAB
Keystone
[DEFAULT]
admin_token = c01f11a39faceecde032
[catalog]
driver = keystone.catalog.backends.sql.Catalog
[cors]
allowed_origin = *
allow_credentials = true
expose_headers = X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token
allow_methods = GET,PUT,POST,DELETE,PATCH
allow_headers = X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token,X-Project-Id,X-Project-Name,X-Project-Domain-Id,X-Project-Domain-Name,X-Domain-Id,X-Domain-Name
[database]
connection = mysql+pymysql://keystone:fNJMScfy7XnC9jX3KS9saMWHPrGbq8VS@127.0.0.1/keystone
[eventlet_server]
bind_host = 127.0.0.1
public_bind_host = 127.0.0.1
admin_bind_host = 127.0.0.1
[identity]
driver = keystone.identity.backends.sql.Identity
[token]
provider = fernet
[tokenless_auth]
[trust]
I would really appreciate if anyone can tell me if it’s a bug, or a misconfiguration, it’s been days working on it but getting no fix. Thanks.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (8 by maintainers)
gnocchi-metricd does not relate to API. you should check your gnocchi-api logs to see what the 500 error is.
I could get result by changing userame and password from
gnocchitoadminin mygnocchi.conf.But if it was owing to username-password, why would it show me two 200 and 201 plus a 401 from keystone log? And why 503 ?? I don’t get why logs and status codes were not clear enough to help.
BTW, I have setup gnocchi user in openstack as mentioned in documentation, I can’t understand why user gnocchi and its password couldn’t give me any metric?
The output of my commands successfully executed :
openstack metric resource list
gnocchi resource list
gnocchi metric list --debug
If you don’t see anything in why Apache returns 503, no I can’t really guess. Nothing in
/var/log/httpd/gnocchi.log?@ParsaX If you configure Gnocchi to use Keystone with in
auth_mode, you need to give it proper credentials to authenticate. By default gnocchiclient uses the basic authentication, but you can imagine it’s not gonna work against Keystone.Reading the documentation, you need to set do
. admin-openrcand probably typeexport OS_AUTH_TYPE=passwordto have your gnocchi client work and use Keystone. When that done, please paste a copy ofenv | grep OS_(remove passwords!) and the result ofgnocchi --debug metric list.