InvalidTimeInterval exception during DST switch (graphite 0.99)

Bug #952053 reported by Anton Tolchanov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Graphite
Fix Released
High
Unassigned

Bug Description

It's now 3:55 AM in New York and I get the following error when trying to get a metric from graphite:

https://graphite.xxx.net/render/?width=586&height=308&_salt=1331452227.225&target=host.metric1&from=-1hours

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.6/dist-packages/graphite/render/views.py", line 105, in renderView
    seriesList = evaluateTarget(requestContext, target)
  File "/usr/lib/python2.6/dist-packages/graphite/render/evaluator.py", line 10, in evaluateTarget
    result = evaluateTokens(requestContext, tokens)
  File "/usr/lib/python2.6/dist-packages/graphite/render/evaluator.py", line 21, in evaluateTokens
    return evaluateTokens(requestContext, tokens.expression)
  File "/usr/lib/python2.6/dist-packages/graphite/render/evaluator.py", line 24, in evaluateTokens
    return fetchData(requestContext, tokens.pathExpression)
  File "/usr/lib/python2.6/dist-packages/graphite/render/datalib.py", line 227, in fetchData
    dbResults = dbFile.fetch( timestamp(startTime), timestamp(endTime) )
  File "/usr/lib/python2.6/dist-packages/graphite/storage.py", line 295, in fetch
    (timeInfo,values) = whisper.fetch(self.fs_path, startTime, endTime)
  File "/usr/lib/pymodules/python2.6/whisper.py", line 643, in fetch
    return file_fetch(fh, fromTime, untilTime)
  File "/usr/lib/pymodules/python2.6/whisper.py", line 659, in file_fetch
    raise InvalidTimeInterval("Invalid time interval")
InvalidTimeInterval: Invalid time interval

I guess, it has something to do with the fact that 1 hour ago was 1:55 rather than 2:55 (1:59 was followed by 03:00 during a DST switch).

Anton Tolchanov (knyar)
summary: - InvalidTimeInterval exception during DST switch
+ InvalidTimeInterval exception during DST switch (graphite 0.99)
Revision history for this message
Gareth Llewellyn (garjth) wrote :

0.98 rather than 0.99 but similar issue for switch to British Summer Time:

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/opt/graphite/webapp/graphite/render/views.py", line 101, in renderView
    seriesList = evaluateTarget(requestContext, target)
  File "/opt/graphite/webapp/graphite/render/evaluator.py", line 10, in evaluateTarget
    result = evaluateTokens(requestContext, tokens)
  File "/opt/graphite/webapp/graphite/render/evaluator.py", line 21, in evaluateTokens
    return evaluateTokens(requestContext, tokens.expression)
  File "/opt/graphite/webapp/graphite/render/evaluator.py", line 24, in evaluateTokens
    return fetchData(requestContext, tokens.pathExpression)
  File "/opt/graphite/webapp/graphite/render/datalib.py", line 212, in fetchData
    dbResults = dbFile.fetch( timestamp(startTime), timestamp(endTime) )
  File "/opt/graphite/webapp/graphite/storage.py", line 267, in fetch
    (timeInfo,values) = whisper.fetch(self.fs_path, startTime, endTime)
  File "/usr/lib/python2.6/site-packages/whisper.py", line 523, in fetch
    return file_fetch(fh, fromTime, untilTime)
  File "/usr/lib/python2.6/site-packages/whisper.py", line 539, in file_fetch
    raise InvalidTimeInterval("Invalid time interval")
InvalidTimeInterval: Invalid time interval

Revision history for this message
Michael Leinartas (mleinartas) wrote :

Anton, since this happened to you 2 weeks ago I'm curious to know if you have the same symptoms when selecting that same period from the DST change on March 11th.

Changed in graphite:
importance: Undecided → High
milestone: none → 0.9.10
Revision history for this message
Anton Tolchanov (knyar) wrote :

Michael,

> date -d '380 hours ago'
Sun Mar 11 01:22:33 EST 2012
> date -d '379 hours ago'
Sun Mar 11 03:22:39 EDT 2012

I tried https://graphite.xxx.net/render/?width=586&height=308&target=host.metric1&from=-379hours and https://graphite.xxx.net/render/?width=586&height=308&target=host.metric1&from=-380hours and both rendered without any errors.

Also, selecting both 02:30 and 03:30 as a starting point in extjs UI produced the same correct result (no error message).

I hope this helps.

Revision history for this message
Michael Leinartas (mleinartas) wrote :

Fixed in r739. Note that timestamps on the X axis are still off for these periods.. That may be addressed in a separate bug

Changed in graphite:
status: New → Fix Committed
Changed in graphite:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.