Ask Your Question

Revision history [back]

I faced the same 500 Internal Server Error, as posted above, for the same platform :Openstack Queens multi-node setup on Ubuntu 16.04.4 LTS. Gnocchi version: 4.2.4.

The Apache logs for gnocchi-api (/var/log/apache2/gnocchi_error.log) showed a Python import error:

root@OSControllerTest:/home/osctest# tail -f /var/log/apache2/gnocchi_error.log
2018-11-13 11:17:25.590909 Traceback (most recent call last):
2018-11-13 11:17:25.591242   File "/usr/bin/gnocchi-api", line 20, in <module>
2018-11-13 11:17:25.592009     from gnocchi.cli import api
2018-11-13 11:17:25.592167 ImportError: No module named gnocchi.cli
2018-11-13 12:49:21.263089 mod_wsgi (pid=2049): Target WSGI script '/usr/bin/gnocchi-api' cannot be loaded as Python module.
2018-11-13 12:49:21.263512 mod_wsgi (pid=2049): Exception occurred processing WSGI script '/usr/bin/gnocchi-api'.
2018-11-13 12:49:21.263560 Traceback (most recent call last):
2018-11-13 12:49:21.263605   File "/usr/bin/gnocchi-api", line 20, in <module>
2018-11-13 12:49:21.263762     from gnocchi.cli import api
2018-11-13 12:49:21.263823 ImportError: No module named gnocchi.cli

The import issue was resolved by installing the python-gnocchi package, as suggested by the author above:

apt install python-gnocchi

However, there was still an issue related to authentication (HTTP 401):

osctest@OSControllerTest:~$ gnocchi status
The request you have made requires authentication. (HTTP 401)

This was resolved by setting the environment variable OS_AUTH_TYPE=password in the admin-openrc file. The additional GNOCCHI_ENDPOINT variable as suggested by the author was not required, The final admin-openrc file looks like this:

export OS_USERNAME=admin
export OS_PASSWORD=test123
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
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

After sourcing the updated openrc file, the gnocchi API seems to be working correctly:

osctest@OSControllerTest:~$ gnocchi status
+-----------------------------------------------------+-------+
| Field                                               | Value |
+-----------------------------------------------------+-------+
| storage/number of metric having measures to process | 0     |
| storage/total number of measures to process         | 0     |
+-----------------------------------------------------+-------+

osctest@OSControllerTest:~$ gnocchi server version
+---------+-------+
| Field   | Value |
+---------+-------+
| version | 4.2.4 |
+---------+-------+