Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render failure with movingAverage and from=-24h #201

Open
KristianLyng opened this issue Nov 6, 2016 · 3 comments
Open

Render failure with movingAverage and from=-24h #201

KristianLyng opened this issue Nov 6, 2016 · 3 comments

Comments

@KristianLyng
Copy link

http://172.17.0.78/render/?target=movingAverage(ping.e29-2.ipv4,2)&format=svg&from=-24h

Throws a tantrum/exception.

http://172.17.0.78/render/?target=movingAverage(ping.e29-2.ipv4,2)&format=svg&from=-25h
http://172.17.0.78/render/?target=movingAverage(ping.e29-2.ipv4,2)&format=svg&from=-23h
http://172.17.0.78/render/?target=ping.e29-2.ipv4&format=svg&from=-24h

etc work.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3/dist-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1625, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python3/dist-packages/graphite_api/app.py", line 401, in render
    series_list = evaluateTarget(context, target, data_store)
  File "/usr/lib/python3/dist-packages/graphite_api/app.py", line 496, in evaluateTarget
    result = evaluateTokens(requestContext, tokens, data_store)
  File "/usr/lib/python3/dist-packages/graphite_api/app.py", line 506, in evaluateTokens
    return evaluateTokens(requestContext, tokens.expression, data_store)
  File "/usr/lib/python3/dist-packages/graphite_api/app.py", line 520, in evaluateTokens
    ret = func(requestContext, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/graphite_api/functions.py", line 919, in movingAverage
    seconds=bootstrapSeconds)
  File "/usr/lib/python3/dist-packages/graphite_api/functions.py", line 2114, in _fetchWithBootstrap
    newValues.extend([value] * ratio)
TypeError: can't multiply sequence by non-int of type 'float'

(format can be blank too)

Using graphite-api 1.1.3 (or 1.1.3-2 from Debian Stretch, strictly speaking) guincorn3.

@KristianLyng
Copy link
Author

I'm hitting this same thing with with holtWinters* too, but even more so. Presumably because it will use other time ranges behind the scenes to feed the algorithm.

I'm also noticing that my bandwidth metrics from SNMP are a lot less (if at all) susceptible to this. I'm speculating that this is related to them being positive integers (and always increasing) as opposed to floats. But it might also be related to the fact that I store latency data in 1s precision while snmp-data is stored in 60s precision, so there's going to be a lot more latency data than SNMP.

@horazont
Copy link

horazont commented Apr 8, 2017

Confirmed with

Package: graphite-api
Version: 1.1.3-2

(Debian stretch/testing)

I feel this might be related to downscaling happening.

Is this something an upgrade would fix?

@choplin
Copy link

choplin commented Sep 5, 2017

I also encountered this bug. Through my investigation, I found that the bug is caused because / in _fetchWithBootstrap returns float with Python3.
https://github.com/brutasse/graphite-api/blob/1.1.3/graphite_api/functions.py#L2109

However, at the current Head, _fetchWithBootstrap has been completely remoevd by 7d93840. So the bug would be fixed in the next release, or you can avoid the bug with the version 1.1.3 by using Python2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants