Exception in gnocchi-metricd: ValueError: cannot reindex from a duplicate axis
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Gnocchi |
Fix Released
|
High
|
Chris Dent |
Bug Description
gnocchi-metricd is crashing often with that error:
2015-07-16 14:06:17.581 3062 DEBUG gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
2015-07-16 14:06:17.631 3062 ERROR gnocchi.
Chris Dent (cdent) wrote : | #1 |
Chris Dent (cdent) wrote : | #2 |
There's a stackoverflow question about it, for reference: http://
Changed in gnocchi: | |
importance: | Undecided → High |
status: | New → Triaged |
Chris Dent (cdent) wrote : | #3 |
This happens when some of the measure awaiting processing by metricd have the same timestamp. That timestamp is the axis/index and pandas is not willing to have duplicates there.
That suggests some options, the last of which seems to be the least likely to cause havoc:
* raise granularity of timestamps
* ignore the entire current lump being processed when there is a ValueError that indicate
* drop measures of the same metric that have duplicate timestamps (presumably by using drop_duplicates: http://
Julien Danjou (jdanjou) wrote : | #4 |
You cannot raise the granularity of timestamp, they go up to the nanosecond. The thing is that the timestamp is provided by the user, and if it provides twice the same timestamp even with the same value, well the problem is going to occur.
I think we should simply ignore the oldest one.
Do you have a unit test case that reproduces this?
Changed in gnocchi: | |
assignee: | nobody → Chris Dent (chdent) |
Fix proposed to branch: master
Review: https:/
Changed in gnocchi: | |
status: | Triaged → In Progress |
Reviewed: https:/
Committed: https:/
Submitter: Jenkins
Branch: master
commit 262e8454f977b20
Author: Chris Dent <email address hidden>
Date: Tue Jul 21 17:38:05 2015 +0000
Don't allow duplicate timestamps in carbonara series
If the calling code provides timestamp/value pairs with duplicate
timestamps pandas will raise a ValueError when trying to operate on the
index of the data set. We avoid this problem by removing duplicates in
the timeseries. The assumption being made here is that some single
metric can't have two different measurements at the same time, that's a
violation of physics.
The change is in place for both __init__ and set_values to insure
that the internal representation of the timeseries is consistent no
matter how it is created.
Change-Id: Ib293714e26eca6
Closes-Bug: #1475329
Changed in gnocchi: | |
status: | In Progress → Fix Committed |
Changed in gnocchi: | |
milestone: | none → 1.1.0 |
status: | Fix Committed → Fix Released |
I'm getting this as well when using the 'file' backend.
It's stable, in the sense that you can shutdown metricd and start it back up and there error is still there, so presumably at some point something bad is being written and from that point forward, boom.