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

[Bug] "Direct link rendered image" shows 404 when using scripted dashboard and http_proxy #7246

Closed
gerrickw opened this issue Jan 13, 2017 · 6 comments

Comments

@gerrickw
Copy link

Please include this information:

  • What Grafana version are you using?
    v4.1.0-beta1

  • What datasource are you using?
    influxdb

  • What OS are you running grafana on?
    Ubuntu 14.04

  • What did you do?

  1. Set trace logging on grafana-server, http_proxy, https_proxy. Set no_proxy to server_hostname,localhost,ip. Confirmed these are working with alerting through proxy and database pulls outside proxy.
  2. Create a scripted dashboard under /usr/share/grafana/public/dashboards/scripted.js.
  3. Browse to http://grafana-site/dashboard/script/scripted.js
  4. Click a title of a graph and click "Share"
  5. Click "Direct link rendered image"
  6. Notice: Browser shows a url such as, http://grafana-site/render/dashboard-solo/script/scripted.js?x=y, y=z,span=2&from=1484264019711&to=1484267619711&var-colo=foo&panelId=2&width=1000&height=500
  7. User is shown, "404 page not found"
  8. Checking the logs:
    t=2017-01-12T16:37:40-0800 lvl=info msg=Rendering logger=png-renderer path="dashboard-solo/script/scripted.js?x=y,y=z,span=2&from=1484264019711&to=1484267619711&var-colo=foo&panelId=2&width=1000&height=500"
    t=2017-01-12T16:37:40-0800 lvl=info msg="Request Completed" logger=context userId=0 orgId=1 uname= method=GET path=/dashboard-solo/script/scripted.js status=200 remote_addr=127.0.0.1 time_ms=2ns size=2352
    t=2017-01-12T16:37:51-0800 lvl=dbug msg="Image rendered" logger=png-renderer path=/var/lib/grafana/png/NQOEx2u1N07TYVPv2ZCl.png
    t=2017-01-12T16:37:51-0800 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=user method=GET path=/render/dashboard-solo/script/scripted.js status=404 remote_addr=192.168.1.200 time_ms=10.827µs size=43
  9. Note: Rendering a graph from a dashboard that is not from a script is working correctly.
  10. Comment out no_proxy, http_proxy, https_proxy and restart grafana-service.
  11. Re-attempt steps 2-5.
  12. Notice: Image is shown.
  • What was the expected result?
    User is shown a graph image similar to how a dashboard from the database is generated.

  • What happened instead?

    • User is shown, "404 page not found"
    • It appears the log shows an image is rendered at /var/lib/grafana/png, but the image does not exist. Images do exist for database dashboard direct image renders.
    • Commenting out no_proxy, http_proxy, https_proxy causes scripted dashboard's phantomjs direct images to work correctly.

Let me know if you need more info -- Thanks.

@gerrickw gerrickw changed the title [Bug] PhantomJS might not be using no_proxy for scripted dashboards [Bug] "Direct link rendered image" shows 404 when using scripted dashboard and http_proxy Jan 13, 2017
@torkelo
Copy link
Member

torkelo commented Jan 13, 2017

not sure how to get phantomjs to use those environment variables.

@gerrickw
Copy link
Author

Was poking around phantomJS github issue repo and noticed there were a number of issues surrounding no_proxy for phantomjs, although the last comment on ariya/phantomjs#12863 states 2.1.1 now works with no_proxy environment variable. Are we using the latest phantomJS build?

@torkelo
Copy link
Member

torkelo commented Jan 18, 2017

then it should work as Grafana 4.x has been using PhantomJS 2.1.14

@torkelo torkelo closed this as completed Mar 21, 2017
@gerrickw
Copy link
Author

I am confused, was this fixed in the latest release? It was mentioned it should work if on phantom 2.1.14, but it was not last I checked in grafana.

@torkelo
Copy link
Member

torkelo commented Mar 21, 2017

Sorry, misread your comment

@torkelo torkelo reopened this Mar 21, 2017
@hugohaggmark
Copy link
Contributor

Grafana doesn't support PhantomJS any longer, so I'm going to close this.

Thank You to you for taking the time to create this issue!

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

No branches or pull requests

3 participants