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

Error in plugin: Got permission denied while trying to connect to the Docker daemon socket #684

Open
rsuplina opened this issue May 9, 2023 · 1 comment

Comments

@rsuplina
Copy link

rsuplina commented May 9, 2023

Hello I'm hitting an issue while trying to setup InfluxDB with Telegraf

ls -ln /var/run/docker.sock | awk '{print $4}'

1

THIS IS MY telegraf docker-compose part

  telegraf:
    image: telegraf:1.19
    container_name: telegraf
    user: telegraf:1
    volumes:
      - ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:rw
      - /var/run/docker.sock:/var/run/docker.sock
    env_file:
      - .env
    depends_on:
      - influxdb

and my error

telegraf       | 2023-05-09T16:23:00Z E! [inputs.docker] Error in plugin: 
Got permission denied while trying to connect to the Docker daemon socket 
at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.21/containers/json?
filters=%7B%22status%22%3A%5B%22running%22%5D%7D&limit=0":
 dial unix /var/run/docker.sock: connect: permission denied
@powersj
Copy link
Contributor

powersj commented May 23, 2023

ls -ln /var/run/docker.sock | awk '{print $4}'
1

That's an odd group ID for the docker socket. Are you certain it is 1? Can you show stat /var/run/docker.sock?

I would also suggest jumping into the telegraf container and running the same command.

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

2 participants