Skip to content

Docker Permission Error upon initial installation... #620

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

Closed
jewettg opened this issue Nov 8, 2024 · 4 comments
Closed

Docker Permission Error upon initial installation... #620

jewettg opened this issue Nov 8, 2024 · 4 comments

Comments

@jewettg
Copy link

jewettg commented Nov 8, 2024

Hello .. hoping you can help me get past this error message. I wish I knew more about Docker and could understand this, alas I only understand the basics (getting one built and running) and this error is regarding permissions, which stumped me.

Raspberry Pi 5 Model B Rev 1.0
RaspPi OS v6.6.61 (Debian 12.2.0-14)
4GB of RAM
64GB SD Card

Following your instructions in the README, everything worked, customized inventory.ini and config.yml.
I set the following:

- grafana_admin_password
- pihole_password
- monitoring_enable: true

No other customizations. Upon launching the playbook, all GREEN for Docker install, convenience script, Docker started, dependencies are met for Debian, Archlinux, docker group "pi", reset connection so docker group is picked up, gather facts, add buster backports apt key, add buster backports for fixed libseccomp2, install libseccomp2.4.4, sync internet-monitoring directory, ensure internet-monitoring is not a Git repo, copy templated internet-monitoring files into place .. and then BOOM!

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.47/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.47/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.47/version\": dial unix /var/run/docker.sock: connect: permission denied"], "stdout": "{\"Client\":{\"Platform\":{\"Name\":\"Docker Engine - Community\"},\"Version\":\"27.3.1\",\"ApiVersion\":\"1.47\",\"DefaultAPIVersion\":\"1.47\",\"GitCommit\":\"ce12230\",\"GoVersion\":\"go1.22.7\",\"Os\":\"linux\",\"Arch\":\"arm64\",\"BuildTime\":\"Fri Sep 20 11:41:19 2024\",\"Context\":\"default\"},\"Server\":null}\n", "stdout_lines": ["{\"Client\":{\"Platform\":{\"Name\":\"Docker Engine - Community\"},\"Version\":\"27.3.1\",\"ApiVersion\":\"1.47\",\"DefaultAPIVersion\":\"1.47\",\"GitCommit\":\"ce12230\",\"GoVersion\":\"go1.22.7\",\"Os\":\"linux\",\"Arch\":\"arm64\",\"BuildTime\":\"Fri Sep 20 11:41:19 2024\",\"Context\":\"default\"},\"Server\":null}"]}

Have any ideas? Would love to use your solution to monitor my internet and be able to answer that age old question from the household .. "Is the internet down again?!"

Thank you!

@quadespresso
Copy link
Contributor

You might need to follow these instructions if you haven't already done so: https://docs.docker.com/engine/install/linux-postinstall/

To test to see whether you need to, login to your RPi as your non-root user, then try to run a command such as docker ps. You will very likely hit the same permission denied error.

If so, follow the instructions at the above link, then logout/login and try again. If you no longer get that error, retry your playbook.

@jewettg
Copy link
Author

jewettg commented Nov 9, 2024

Thank you for the prompt response! That might need to make it into the playbook or instructions. That solved my immediate installation .. and the playbook is continuing to run past the "Ensure internet-monitoring environment is running" play.

@jewettg
Copy link
Author

jewettg commented Nov 9, 2024

OK, the playbook finished and the PiHole webpage appears.. now to learn more about these to apps and such. Thank you very much for your assistance!

@jewettg jewettg closed this as completed Nov 9, 2024
tylermilner added a commit to tylermilner/internet-pi that referenced this issue Feb 11, 2025
Add note about adding user to `docker` user group to fix permission denied error when running playbook based on discussion in geerlingguy#620.
@tylermilner
Copy link

I encountered this same issue when setting up internet-pi on my freshly imaged Raspberry Pi 5 as well. In my case, the docker group was already present and all I needed to do was add the user to the group by running sudo usermod -aG docker $USER. After doing that, running the playbook using ansible-playbook main.yml succeeded.

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

3 participants