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

502 error 53: connect: cannot assign requested address #24

Open
jeanfrancoislarente opened this issue Mar 1, 2021 · 2 comments
Open

Comments

@jeanfrancoislarente
Copy link

Trying to use the docker-compose file as-is and the error I'm getting in the grafana container logs is:

grafana_1    | t=2021-03-01T19:06:09+0000 lvl=info msg="Request Completed" logger=context userId=0 orgId=1 uname= method=GET path=/api/datasources/proxy/1/query status=502 remote_addr=192.168.2.144 time_ms=1 size=0 referer="http://192.168.2.168:3020/d/0A6hxROiz/speedtest-results?orgId=1"

192.168.2.168 is my "docker machine" and 192.168.2.144 is my windows client which is accessing grafana via http://192.168.2.168:3020 (3020 is the port I specified for grafana)

Env file (not much changed)

GRAFANA_PORT=3020
SPEEDTEST_SPEEDTEST_INTERVAL=3600
SPEEDTEST_HOST=local

docker-compose file , should be same as master branch

version: '2'

services:
  influxdb:
    restart: always
    image: influxdb:1.8
    ports:
      - "8086:8086"
    volumes:
      - "./data/influxdb/:/var/lib/influxdb"
    environment:
      - "INFLUXDB_ADMIN_USER=admin"
      - "INFLUXDB_ADMIN_PASSWORD=password"
      - "INFLUXDB_DB=speedtest"

  grafana:
    restart: always
    image: grafana/grafana:6.7.2
    volumes:
      - "./docker/grafana/provisioning:/etc/grafana/provisioning"
    ports:
      - "${GRAFANA_PORT}:3000"
    environment:
      - "GF_SERVER_ROOT_URL=http://localhost"
      - "GF_SECURITY_ADMIN_PASSWORD=admin"
      - "GF_AUTH_ANONYMOUS_ENABLED=true"
    depends_on:
      - influxdb

  speedtest:
    restart: always
    image: frdmn/speedtest-grafana:latest
    container_name: speedtest
    environment:
      - "SPEEDTEST_INTERVAL=${SPEEDTEST_SPEEDTEST_INTERVAL}"
      - "SPEEDTEST_HOST=${SPEEDTEST_HOST}"
    depends_on:
      - influxdb
@jeanfrancoislarente
Copy link
Author

So I figured out that the issue was that grafana can't resolve influxdb, so I went into the docker\grafana\provisioning\datasources\influxdb.yml file and updated the url to be the IP address.

I'd love some insight (if you have any) on why my grafana container can't resolve.

@jeanfrancoislarente
Copy link
Author

I get "permission denied" when I attach to container and run cat /etc/resolv.conf

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

No branches or pull requests

1 participant