Bug 1904092 - "gnocchi status" command returns HTTP 500 error in RHOSP 16.1 deployments
Summary: "gnocchi status" command returns HTTP 500 error in RHOSP 16.1 deployments
Keywords:
Status: CLOSED DUPLICATE of bug 1883733
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-gnocchi
Version: 16.1 (Train)
Hardware: All
OS: All
unspecified
medium
Target Milestone: ---
: ---
Assignee: Martin Magr
QA Contact: Leonid Natapov
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-03 14:15 UTC by Alex Stupnikov
Modified: 2024-06-13 23:42 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-12-09 16:14:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
redis_trace.log (11.30 KB, text/plain)
2020-12-03 14:18 UTC, Alex Stupnikov
no flags Details
typeerror_trace.log (8.53 KB, text/plain)
2020-12-03 14:18 UTC, Alex Stupnikov
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-32296 0 None None None 2024-06-13 23:42:30 UTC

Description Alex Stupnikov 2020-12-03 14:15:06 UTC
Description of problem:

Customer reported the following problem for RHOSP 16.1 deployment where Gnocchi is configured to use RBD to store metrics. I also was able to reproduce it in my lab.

Every "gnocchi status" command fails with HTTP 500 error [1]. It is interesting that this problem actually could have two different causes:

1. "TypeError: keys must be a string", which occurs because json encoder is not able to encode some variable.
2. "redis.exceptions.ConnectionError: Error while reading from socket: ('Connection closed by server.',)", which likely occurs because Redis connection from cache(?) is timed out.

Second cause is reproduced when "gnocchi status" command is issued after some period of time. It looks like gnocchi cached active connections to Redis, but fails to resume it. I can see two possible problems here: 

a. Gnocchi and redis configurations are likely not aligned in RHOSP
b. Gnocchi fails to process request instead of trying to re-initiate cached connection

First problem is reproduced in all other cases.

I will use file attachements to provide Python traces from /var/log/containers/httpd/gnocchi-api/gnocchi_wsgi_error.log 

[1]
$ 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>
</body></html>
 (HTTP 500)

Comment 1 Alex Stupnikov 2020-12-03 14:18:15 UTC
Created attachment 1736102 [details]
redis_trace.log

Comment 2 Alex Stupnikov 2020-12-03 14:18:38 UTC
Created attachment 1736103 [details]
typeerror_trace.log

Comment 3 Alex Stupnikov 2020-12-03 14:22:34 UTC
I have attached two error traces from /var/log/containers/httpd/gnocchi-api/gnocchi_wsgi_error.log (all data is collected in my lab and doesn't contain anything private):

1. redis_trace.log:
   Dec  3 14:05:55 controller-0 haproxy[15]: 10.0.0.24:47704 [03/Dec/2020:14:05:54.704] gnocchi gnocchi/controller-0.internalapi.redhat.local 0/0/0/473/473 500 707 - - ---- 129/1/0/0/0 0/0 "GET /v1/status?details=False HTTP/1.1"

2. typeerror_trace.log:
   Dec  3 12:46:27 controller-0 haproxy[15]: 10.0.0.24:59222 [03/Dec/2020:12:46:27.357] gnocchi gnocchi/controller-0.internalapi.redhat.local 0/0/0/449/449 500 707 - - ---- 
91/1/0/0/0 0/0 "GET /v1/status?details=False HTTP/1.1"


Note You need to log in before you can comment on or make changes to this bug.