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: Docker host socket at /var/run/docker.sock is not readable #1179

Closed
andrei-datcu opened this issue Jan 6, 2025 · 5 comments · Fixed by #1182
Closed

Error: Docker host socket at /var/run/docker.sock is not readable #1179

andrei-datcu opened this issue Jan 6, 2025 · 5 comments · Fixed by #1182

Comments

@andrei-datcu
Copy link

andrei-datcu commented Jan 6, 2025

REPOSITORY                  TAG                 IMAGE ID            CREATED             SIZE
nginxproxy/acme-companion   latest              a4f6c6c20efa        3 weeks ago         46.6MB

Info: running acme-companion version v2.5.1-6-gea11f22
Error: Docker host socket at /var/run/docker.sock is not readable. Please check user permissions
If you are in a SELinux environment, try using: '-v /var/run/docker.sock:/var/run/docker.sock:z'

Note that the socket seems to be readable. Binding with :z doesn't make any difference:

Proof:

348d706f16fe:/app# bash ./entrypoint.sh /bin/bash /app/start.sh
Info: running acme-companion version v2.5.1-6-gea11f22
Error: Docker host socket at /var/run/docker.sock is not readable. Please check user permissions
If you are in a SELinux environment, try using: '-v /var/run/docker.sock:/var/run/docker.sock:z'
348d706f16fe:/app# ls -alh /var/run/docker.sock 
srw-rw---- 1 root 998 0 Aug 12 13:24 /var/run/docker.sock
348d706f16fe:/app# 
exit

Executing start.sh works.

Docker host

  • OS: Debian 10 Linux debian 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64 GNU/Linux
  • Docker version:
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b7f0
 Built:             Wed Mar 11 01:25:56 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b7f0
  Built:            Wed Mar 11 01:24:28 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Other (intersting info):

test -r fails for any file in the container
test -S /var/run/docker.sock is successful

@buchdag
Copy link
Member

buchdag commented Jan 8, 2025

Hi.

Could you provide your complete nginx-proxy + acme-companion setup ?

Are you running SELinux or something similar on this host ?

I noticed the version of Docker you're running is almost five years old, maybe this is related, maybe not.

@andrei-datcu
Copy link
Author

No SELinux, the host is a 2vCPU VPS.
Here's the relevant part of the docker compose file:

    nginx: # includes static files
        image: jwilder/nginx-proxy:alpine
        labels:
            com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
        restart: always
        volumes:
            - /var/run/docker.sock:/tmp/docker.sock:ro
            - nginx_certs:/etc/nginx/certs:ro
            - nginx_vhost:/etc/nginx/vhost.d
            - nginx_dhparam:/etc/nginx/dhparam
            - nginx_html_challange:/usr/share/nginx/html
        ports:
            - "80:80"
            - "443:443"
        depends_on: 
            - app

    letsencrypt:
        image: nginxproxy/acme-companion
        restart: always
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock:ro
            - nginx_certs:/etc/nginx/certs:rw
            - nginx_vhost:/etc/nginx/vhost.d
            - nginx_dhparam:/etc/nginx/dhparam
            - nginx_html_challange:/usr/share/nginx/html
            - acme:/etc/acme.sh
        environment:
            - DEFAULT_EMAIL=${LETSENCRYPT_ALERT_EMAIL}

The docker engine on the host is indeed ancient. Reversing the initial checks in the entrypoint script would work, though: if test -S fails, then do a test -r to decide on the what error message is shown. Would that be acceptable?

@PixiBixi
Copy link

Same issue here, rollbacked to tag 2.4 and it works (not functional with 2.5)

@buchdag
Copy link
Member

buchdag commented Jan 18, 2025

@andrei-datcu I'll look into this either tomorrow if I have time or next week but yes I think the check is the culprit too.

I was thinking of doing a real call to the Docker API (more specifically to the /_ping endpoint) to check if the container can access the Docker API rather that doing a test -S or test -r that don't tell us much beside the existence of a socket file with some specific permissions.

edit : I think the test -S fix can be done right now.

@buchdag buchdag linked a pull request Jan 18, 2025 that will close this issue
@buchdag
Copy link
Member

buchdag commented Jan 19, 2025

I've released version 2.5.2 with the fix for this issue, 2.5 should be updated too.

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

Successfully merging a pull request may close this issue.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy