hassio-addons / addon-grafana

Grafana - Home Assistant Community Add-ons
https://addons.community
MIT License
228 stars 64 forks source link

Web UI works but 502 Bad gateway trying to access grafana.com #60

Closed LongDono closed 3 years ago

LongDono commented 4 years ago

Problem/Motivation

My installation of Grafana has a working web UI but the application itself is not able to access the Internet for things such as plug-ins or importing dashboards.

Expected behavior

The application should be able to access Internet resources as designed, such as displaying the Plug-in repository or allowing you to import a dashboard.

Actual behavior

Clicking Explore-plugins gives the full-screen grey page with the broken page icon and "grafana.com refused to connect".

Trying to import a dashboard, such as for Glances using the ID #, results in the following error appearing: {"data":"502: Bad Gateway","status":502,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"api/gnet/dashboards/2387","retry":0,"headers":{"X-Grafana-Org-Id":1,"Accept":"application/json, text/plain, */*"}},"statusText":"Bad Gateway","xhrStatus":"complete","isHandled":true}

Screenshot

Grafana add-on log: No errors

Supervisor log: 19-12-17 23:25:38 ERROR (MainThread) [hassio.api.ingress] Ingress error: Response payload is not completed 19-12-17 23:25:47 ERROR (MainThread) [hassio.api.ingress] Ingress error: Response payload is not completed

Steps to reproduce

Server is running Ubuntu 18.04 LTS. Hass.io is installed using the generic Linux host option. Grafana was installed as add-on using Hass.io. Default Grafana configuration. Not clear if this is reproducible or something specific to my configuration/environment.

addons-assistant[bot] commented 4 years ago

:wave: Thanks for opening your first issue here! If you're reporting a :bug: bug, please make sure you include steps to reproduce it. Also, logs, error messages and information about your hardware might be usefull.

sinclairpaul commented 4 years ago

For the explore issue can you confirm you see something similar in the browser console (as its an IFrame by looking at it).

image

For the import I see a request sent to /api/gnet/dashboards/2387 which responds ok in the container, but wonder if something in ingress fails as its a json returned.

btw they are both reproducible :)

LongDono commented 4 years ago

Yes, that is indeed the same console error for theExplore plug-in repository option. :)

For the import, the console shows: api/hassio_ingress/B…t/dashboards/2387:1 Failed to load resource: the server responded with a status of 502 (Bad Gateway)

I was also checking other plug-ins earlier to see if they also suffer from this issue and noticed that Chronograf/InfluxDB shows an error where the news feed should be. Sure enough, this is the corresponding error in the console: Access to fetch at 'https://www.influxdata.com/feed/json' from origin 'https://<mydomain>.duckdns.org:18123' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

JPDucky commented 4 years ago

I'm currently experiencing the same problem, I'm getting the error {"data":"502: Bad Gateway","status":502,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"api/gnet/dashboards/4434","retry":0,"headers":{"X-Grafana-Org-Id":1,"Accept":"application/json, text/plain, */*"}},"statusText":"Bad Gateway","xhrStatus":"complete","isHandled":true} when trying to import a dashboard into Grafana from Grafana.com, and I'll get a "Grafana couldn't connect to Grafana.com" error if I try to click on the "Eplore Plugin Repository" button on the home screen. I also get "Failed to load news feed" in InfluxDB.

Let me know what other info you need from me, if you do

thunem commented 4 years ago

Got the same issue as @JPDucky

ninjax95 commented 4 years ago

HI, I use HASSIO, 105.2. I also have the same problem, I wonder if it has something to do with the ingress addon

sinclairpaul commented 4 years ago

The issue is specific to accessing under Ingress, you can expose the addon and these issues do not occur.

If you do not wish to do that, the explore functionality can be managed by right clicking and opening in a new tab/window (its essentially just opening the Grafana site). The import can be performed by downloading the JSON and pasting it.

addons-assistant[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

JPDucky commented 4 years ago

It is still occurring

On Thu, Apr 9, 2020 at 8:56 AM addons-assistant[bot] < notifications@github.com> wrote:

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hassio-addons/addon-grafana/issues/60#issuecomment-611541811, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIEGQEZEAQI543QUP2ZUZNDRLXHZRANCNFSM4J4C7WKA .

-- Palmer Duckworth Petroleum Engineering Graduate from LSU 601-850-9064 454 W. Parker Blvd. Baton Rouge, LA 70808

LongDono commented 4 years ago

Yes, sadly. This ingress issue affects at least one other addon (InfluxDB newsfeed error). It is unfortunate that issues can't remain on the backburner as a reminder for anyone that might be able to figure out a fix rather than be closed unresolved.

gcorgnet commented 4 years ago

Happening here as well (hass.io)

JBurkeHansen commented 4 years ago

And here as well, also hass.io. Import via json works great so thats a work arround.

addons-assistant[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

LongDono commented 4 years ago

This is still something that a future redesign can address (stale bump)

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!