Bad Gateway Errors

CMD screenshot of me accessing influxdb using CLI interface in the Windows Command Line Prompt

access_influxdb_using_cli

Are you able to access the database from a command line running inside the grafana container? I don’t use docker with grafana but I do know that it is necessary to allow the container access to localhost for that to work. Have you tried using the ip address of the machine rather than localhost? Also check that works from the command line in case influx is only accessible via localhost.

[Edit] If you don’t need to enter a user/pwd to access the db in the command line they you should not have basic auth enabled or provide a user/pwd

1 Like

I replaced “localhost” with my IP address and it worked. Maybe that could work for you too.

1 Like

I have tried to reply on the forum, but because i’m a new user i cannot. Yes thankyou i replaced the localhost with IP address and it worked right away.

Maybe you can reply on the forum?

Regards

1 Like

Glad that it worked.

Thank you.

http://localhost:8086 works - you just have to physically type it in the address, as what is shown is an example, and does not default to this

1 Like

I inspected my Grafana docker container using the command docker inspect {containter_name}. I then replaced localhost with the ip address listed under networks section (for example, “IPAddress”: “172.31.0.2”) and it worked for me.

Thank you for this fix! This is not good UI practice. I figured that if something was typed into the textbox, it was the actual value being used. I never thought to type in what was “already” typed in.

The e.g. text should be below or next to the textbox.

image

Hi Team,

I’m facing the same issue of bad gateway 502 and have tried all the above steps
can you please check? I will paste the snapshot of my grafana configuration here


Hi Graffana team,

I am facing the same issue. We had graffana version 5.2.0 it was working fine then we upgraded to other 7.5.5, 8.1.5 and seen this 502 bad gateway error then we have switched back to 5.2.0 but still I am seeing the same error. Below is my configuration

The issue is due to the missing / on the admin interface default value for HTTP host URL field
by default it is set to
http://localhost:8086
you have to change it with
http://localhost:8086/ (do not forget the trailing slash)

it resolved the issue for me

@cfilippe appending / does not resolve my issue, I have tried both with http://localhost:8086/ and also http://influx-influxdb:8086/

Need help on this ASAP

If you are using Influxdb in a container, replace localhost with the container name(same name in the docker compose). It solved the problem for me


I also encountered this problem when I used ‘http://localhost:9090/’, the default port, to solve this problem. But my data is still not shown, maybe the template does not support Windows.