grafana / grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
https://grafana.com
GNU Affero General Public License v3.0
64k stars 11.98k forks source link

Http Errors with graphite #435

Closed abettadapur closed 10 years ago

abettadapur commented 10 years ago

Hello, After following the setup instructions and adding the CORS headers to my apache configuration, my grafana instance still cannot connect to graphite. The http error occurs on the home page and there is no error text. Is there something obvious I'm missing?

jippi commented 10 years ago

Can you please provide full request/response from the network tab?

Also, some browsers cache CORS, you may need to kill chrome/firefox and try in incognito

torkelo commented 10 years ago

That is strange. When you get the error, there is a view details link (should be) with more info on the graphite response error. Or check the Chrome developer tools and see what request is failing and what the request / response is (and paste it here if you can)

abettadapur commented 10 years ago

Remote Address::5000 Request URL:http://:5000/render Request Method:POST Status Code:500 INTERNAL SERVER ERROR Request Headers Accept:application/json, text/plain, / Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 Connection:keep-alive Content-Length:156 Content-Type:application/x-www-form-urlencoded Host::5000 Origin:http://:5100 Referer:http://:5100/ User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36 Form Dataview sourceview URL encoded from:-6h until:now target:randomWalk('random walk') target:randomWalk('random walk2') target:randomWalk('random walk3') format:json maxDataPoints:1920

Response Headers Access-Control-Allow-Headers:origin, authorization, accept Access-Control-Allow-Methods:GET, OPTIONS Access-Control-Allow-Origin:* Connection:keep-alive Content-Type:text/html; charset=utf-8 Date:Thu, 22 May 2014 19:51:53 GMT Server:nginx Transfer-Encoding:chunked

You can see the access-control-headers are properly set. Whats interesting is the error that appears to be thrown by graphite (from the preview window...)

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-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 136, in renderView timestamps = range(series.start, series.end, series.step)TypeError: range() integer end argument expected, got float.

abettadapur commented 10 years ago

This suggests though that I can connect to graphite. But I also cannot query metrics from a new graph create window, so it appears I can't connect...

torkelo commented 10 years ago

@abettadapur this is a bug in graphite (https://github.com/graphite-project/graphite-web/pull/166) was fixed in 0.9.12 , if you are going to upgrade I recommend this patch as well: https://github.com/grafana/grafana/wiki/Performance-for-large-time-spans

abettadapur commented 10 years ago

I see. I will try upgrading and post back with updates. Thanks

abettadapur commented 10 years ago

This was it. Thanks for the swift response