influxdata / influxdata/influxdata-docker

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

Open
#684 2 comments 0 reactions 0 assignees View on GitHub
telegraf waiting for reply
Dominant language
Shell
Stars
364
Forks
255
Avg merge
3h 18m
Merged PRs (30d)
7

Description

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
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the telegraf service in the provided docker-compose configuration and inspect how its user, group, and /var/run/docker.sock volume are set. Reproduce the inputs.docker startup and verify the Docker socket permissions. Done means Telegraf can query the Docker daemon without the permission-denied error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, shell
Domain
devops, observability
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.