Closed mariusmucenicu closed 7 years ago
Can you precise which version of Gnocchi you're running?
Sure, gnocchi==3.1.4 gnocchiclient==3.0.0
Thanks @mariusmucenicu. I wonder if it's not a duplicate of https://github.com/gnocchixyz/gnocchi/issues/69, could you upgrade to 3.1.6 to check that this is not already fixed?
Edit: nevermind, I don't think it is. I misread the bug :)
This has been fixed and backported!
Hello,
We use openstack and gnocchi service for our project and we got an usual behavior while trying to aggregate metrics for "instance_network_interface".
I've traced the exception to its roots and if a granularity is not present when trying to do the aggregation an exception will be thrown, but it doesn't fail gracefully, it fails with a html 500 response (I'm guessing this is the standard exception when pecan can't handle something)
I'll get right to it: I'm looping through some network metrics as follows (this being just a sample of the code)
gnocchi_admin is the python gnocchi client which uses the
gnocchiclient.client.metric.aggregation
which in turn does a request post underv1/aggregation/resource/instance_network_interface/metric/
with some query params (granularity, reaggregation, start, end date)However this fails with a html 500 response as follows
I connected to the gnocchi server and traced the error which fails with the following traceback
So the next thing was to follow the traceback and I've made it to the point where it fails: https://github.com/gnocchixyz/gnocchi/blob/master/gnocchi/rest/__init__.py#L1653
This was for my case but it could fail anywhere in the try except block if the granularity is not found
So evidently I've added an
at the bottom and everything worked fine (failed gracefully), which in turn helped me catch exceptions explicitly etc.
Note that we know what the problem was in the first place (we didn't have a granularity defined in the ARCHIVE POLICY, and have an ARCHIVE POLICY RULE point to our metrics) and we could have avoided the exception doing that, but there are a lot of configurations out there, and I'm guessing this is an issue.
Thanks in advance