Ask Your Question
0

gnocchi 500 internal server error

asked 2018-11-12 01:06:54 -0600

hamed gravatar image

Hi I install openstack queens and install gnocchi.
when input gnocchi-status command (or other gnocchi commands) get blow erorr :

 root@Controller:~# gnocchi status
<!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 
 [no address given] 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>
<hr>
<address>Apache/2.4.18 (Ubuntu) Server at localhost Port 8041</address>
</body></html>
 (HTTP 500)

vim /etc/gnocchi/gnocchi.conf :

[DEFAULT]
log_dir = /var/log/gnocchi
coordination_url = redis://controller:6379

[api]
auth_mode = keystone

[database]
backend = sqlalchemy

# MariaDB connection info
[indexer]
url = mysql+pymysql://gnocchi:hamed@controller/gnocchi

[storage]
driver = file
file_basepath = /var/lib/gnocchi
#coordination_url = redis://controller:6379


# Keystone auth info
[keystone_authtoken]
service_token_roles_required = true
auth_type = password
auth_url = http://controller:5000/v3
project_domain_name = Default
user_domain_name = Default
project_name = service
username = gnocchi
password = hamed
interface = internalURL
region_name = RegionOne

openstack version: queens
OS: ubuntu16.04

edit retag flag offensive close merge delete

Comments

The gnocchi log files should contain details about the error.

Bernd Bausch gravatar imageBernd Bausch ( 2018-11-12 02:58:39 -0600 )edit

could you gather data by gnocchi? aodh alarm list is in insuffient data for me

novainfinite gravatar imagenovainfinite ( 2018-12-20 02:46:20 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2018-11-12 01:23:39 -0600

novainfinite gravatar image

Following config for /etc/apache2/sites-available/gnocchi.conf works fine at this moment:

Listen 8041

<virtualhost *:8041=""> WSGIDaemonProcess gnocchi lang='en_US.UTF-8' locale='en_US.UTF-8' user=stack display-name=%{GROUP} processes=2 threads=32 WSGIProcessGroup gnocchi WSGIScriptAlias / /usr/local/bin/gnocchi-api WSGIApplicationGroup %{GLOBAL}

<IfVersion >= 2.4>
    ErrorLogFormat "%{cu}t %M"
</IfVersion>


<Directory />
    Options FollowSymLinks
    AllowOverride None
    <IfVersion >= 2.4>
        Require all granted
    </IfVersion>
    <IfVersion < 2.4>
        Order allow,deny
        Allow from all
    </IfVersion>
</Directory>

ErrorLog /var/log/apache2/gnocchi.log
CustomLog /var/log/apache2/gnocchi-access.log combined

</virtualhost>

WSGISocketPrefix /var/run/apache2

After service apache2 restart output for command gnocchi status is following:

$ gnocchi status +-----------------------------------------------------+-------+ | Field | Value | +-----------------------------------------------------+-------+ | storage/number of metric having measures to process | 0 | | storage/total number of measures to process | 0 | +-----------------------------------------------------+-------+

Not like before:

$ gnocchi status <html><head> <title>403 Forbidden</title> </head><body>

Forbidden

You don't have permission to access /v1/status on this server.


Apache/2.4.18 (Ubuntu) Server at 10.92.76.44 Port 8041
</body></html> (HTTP 403)

edit flag offensive delete link more

Comments

1

tank you very mach. after your solution, i run bellow command:

apt install python-gnocchi

and add export bellow lines into admin-openrc file for 401 error unauthenticated :

GNOCCHI_ENDPOINT=http://controller:8041

export OS_AUTH_TYPE=password
hamed gravatar imagehamed ( 2018-11-12 12:49:27 -0600 )edit

yourwelcome

novainfinite gravatar imagenovainfinite ( 2018-11-13 01:50:33 -0600 )edit
0

answered 2018-11-13 06:30:32 -0600

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 |
+---------+-------+
edit flag offensive delete link more

Comments

1

tanks. i have same problem, and use your answer and before answer to solve that.

hamed gravatar imagehamed ( 2018-11-14 02:47:33 -0600 )edit

Your Answer

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

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2018-11-12 01:06:54 -0600

Seen: 90 times

Last updated: Nov 12 '18