geerlingguy / internet-pi

Raspberry Pi config for all things Internet.
MIT License
4.29k stars 449 forks source link

[Ensure internet-monitoring environment is running.] - task fails #602

Open nohouse-felix opened 3 months ago

nohouse-felix commented 3 months ago

Hello, I have just tested this project against a Raspberry Pi 4 with the 64 bit version of Raspberry Pi OS bookworm and encountered the following error while running the ansible playbook locally:

TASK [Ensure internet-monitoring environment is running.] *************************** fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": "/usr/bin/docker --host unix:///var/run/docker.sock version --format '{{ json . }}'", "msg": "permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.45/version\": dial unix /var/run/docker.sock: connect: permission denied", "rc": 1, "stderr": "permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.45/version\": dial unix /var/run/docker.sock: connect: permission denied\n", "stderr_lines": ["permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.45/version\": dial unix /var/run/docker.sock: connect: permission denied"], "stdout": "{\"Client\":{\"Platform\":{\"Name\":\"Docker Engine - Community\"},\"Version\":\"26.1.4\",\"ApiVersion\":\"1.45\",\"DefaultAPIVersion\":\"1.45\",\"GitCommit\":\"5650f9b\",\"GoVersion\":\"go1.21.11\",\"Os\":\"linux\",\"Arch\":\"arm64\",\"BuildTime\":\"Wed Jun 5 11:29:12 2024\",\"Context\":\"default\"},\"Server\":null}\n", "stdout_lines": ["{\"Client\":{\"Platform\":{\"Name\":\"Docker Engine - Community\"},\"Version\":\"26.1.4\",\"ApiVersion\":\"1.45\",\"DefaultAPIVersion\":\"1.45\",\"GitCommit\":\"5650f9b\",\"GoVersion\":\"go1.21.11\",\"Os\":\"linux\",\"Arch\":\"arm64\",\"BuildTime\":\"Wed Jun 5 11:29:12 2024\",\"Context\":\"default\"},\"Server\":null}"]}

As suggested I tried reconnecting to my Pi and also tried rebooting but that didn't help. The issue seemed pretty obvious so I ran the following command to add my user (felix) to the docker group:

sudo usermod -aG docker felix

After logging out and logging back in, the playbook ran just fine with no failed tasks. Just wanted to post this here so that other, more unexperienced users can find help when needed.

Greetings, Felix