502 bad Gateway

Hi Team,

I have installed latest version of grafana-5.4.2 and integrated with nagios core using PNP datasource. I am getting following error 502 bad gateway while adding pnp datasource. Please help me in order to resolve this issue.
I already use the same setup on other server and it’s working fine.

t=2019-02-13T18:06:37+0400 lvl=info msg=“Request Completed” logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/2/index.php/api status=502 remote_addr=“IP Addresses” time_ms=30001 size=0 referer=https://Grafana-URL/datasources/edit/2
t=2019-02-13T18:07:40+0400 lvl=info msg=“Request Completed” logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/2/index.php/api status=502 remote_addr=“IP Addresses” time_ms=30001 size=0 referer=https://Grafana-URL/datasources/edit/2

Regards,
rlinux57

Hi,

I have sorted out the issue by myself by adding URL entry for localhost in /etc/hosts file.

Regards,
rlinux57

I have a similar error.

grafana       | EROR[11-26|12:12:40] Data proxy error                         logger=data-proxy-log userId=1 orgId=1 uname=admin path=/api/datasources/proxy/1/api/v1/query remote_addr=172.22.0.1 referer="http://localhost:3000/datasources/edit/1/?utm_source=grafana_gettingstarted" error="http: proxy error: dial tcp 127.0.0.1:9090: connect: connection refused"
grafana       | EROR[11-26|12:12:40] Request Completed                        logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/1/api/v1/query status=502 remote_addr=172.22.0.1 time_ms=4 size=0 referer="http://localhost:3000/datasources/edit/1/?utm_source=grafana_gettingstarted"
grafana       | EROR[11-26|12:13:08] Data proxy error                         logger=data-proxy-log userId=1 orgId=1 uname=admin path=/api/datasources/proxy/1/api/v1/query remote_addr=172.22.0.1 referer="http://localhost:3000/datasources/edit/1/?utm_source=grafana_gettingstarted" error="http: proxy error: dial tcp 127.0.0.1:9090: connect: connection refused"
grafana       | EROR[11-26|12:13:08] Request Completed                        logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/1/api/v1/query status=502 remote_addr=172.22.0.1 time_ms=5 size=0 referer="http://localhost:3000/datasources/edit/1/?utm_source=grafana_gettingstarted"
grafana       | EROR[11-26|12:13:58] Data proxy error                         logger=data-proxy-log userId=1 orgId=1 uname=admin path=/api/datasources/proxy/1/api/v1/query remote_addr=172.22.0.1 referer="http://localhost:3000/datasources/edit/1/?utm_source=grafana_gettingstarted" error="http: proxy error: dial tcp 127.0.0.1:9090: connect: connection refused"
grafana       | EROR[11-26|12:13:58] Request Completed                        logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/1/api/v1/query status=502 remote_addr=172.22.0.1 time_ms=2 size=0 referer="http://localhost:3000/datasources/edit/1/?utm_source=grafana_gettingstarted"
grafana       | EROR[11-26|12:15:26] Data proxy error                         logger=data-proxy-log userId=1 orgId=1 uname=admin path=/api/datasources/proxy/1/api/v1/query remote_addr=172.22.0.1 referer="http://localhost:3000/datasources/edit/1/?utm_source=grafana_gettingstarted" error="http: proxy error: dial tcp 127.0.0.1:9090: connect: connection refused"
grafana       | EROR[11-26|12:15:26] Request Completed                        logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/1/api/v1/query status=502 remote_addr=172.22.0.1 time_ms=4 size=0 referer="http://localhost:3000/datasources/edit/1/?utm_source=grafana_gettingstarted"
grafana       | EROR[11-26|12:16:05] Data proxy error                         logger=data-proxy-log userId=1 orgId=1 uname=admin path=/api/datasources/proxy/1/api/v1/query remote_addr=172.22.0.1 referer="http://localhost:3000/datasources/edit/1/?utm_source=grafana_gettingstarted" error="http: proxy error: dial tcp 127.0.0.1:9090: connect: connection refused"
grafana       | EROR[11-26|12:16:05] Request Completed                        logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/1/api/v1/query status=502 remote_addr=172.22.0.1 time_ms=3 size=0 referer="http://localhost:3000/datasources/edit/1/?utm_source=grafana_gettingstarted"
grafana       | EROR[11-26|12:17:59] Data proxy error                         logger=data-proxy-log userId=1 orgId=1 uname=admin path=/api/datasources/proxy/1/api/v1/query remote_addr=172.22.0.1 referer="http://localhost:3000/datasources/edit/1/?utm_source=grafana_gettingstarted" error="http: proxy error: dial tcp 127.0.0.1:9090: connect: connection refused"
grafana       | EROR[11-26|12:17:59] Request Completed                        logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/1/api/v1/query status=502 remote_addr=172.22.0.1 time_ms=5 size=0 referer="http://localhost:3000/datasources/edit/1/?utm_source=grafana_gettingstarted"
grafana       | EROR[11-26|12:18:02] Data proxy error                         logger=data-proxy-log userId=1 orgId=1 uname=admin path=/api/datasources/proxy/1/api/v1/query remote_addr=172.22.0.1 referer="http://localhost:3000/datasources/edit/1/?utm_source=grafana_gettingstarted" error="http: proxy error: dial tcp 127.0.0.1:9090: connect: connection refused"
grafana       | EROR[11-26|12:18:02] Request Completed                        logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/1/api/v1/query status=502 remote_addr=172.22.0.1 time_ms=9 size=0 referer="http://localhost:3000/datasources/edit/1/?utm_source=grafana_gettingstarted"
grafana       | EROR[11-26|12:18:21] Data proxy error                         logger=data-proxy-log userId=1 orgId=1 uname=admin path=/api/datasources/proxy/2/api/v1/query remote_addr=172.22.0.1 referer=http://localhost:3000/datasources/edit/2/ error="http: proxy error: dial tcp 127.0.0.1:9090: connect: connection refused"
grafana       | EROR[11-26|12:18:21] Request Completed                        logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/2/api/v1/query status=502 remote_addr=172.22.0.1 time_ms=3 size=0 referer=http://localhost:3000/datasources/edit/2/
grafana       | EROR[11-26|12:19:51] Dashboard not found                      logger=context userId=1 orgId=1 uname=admin error="Dashboard not found" remote_addr=172.22.0.1
grafana       | INFO[11-26|12:19:51] Request Completed                        logger=context userId=1 orgId=1 uname=admin method=GET path=/api/dashboards/uid/Oe0reiHef status=404 remote_addr=172.22.0.1 time_ms=3 size=33 referer=http://localhost:3000/dashboard/import