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

Is the docker daemon running? #11894

Open
2 tasks done
sistemmsn opened this issue May 31, 2024 · 8 comments
Open
2 tasks done

Is the docker daemon running? #11894

sistemmsn opened this issue May 31, 2024 · 8 comments
Labels

Comments

@sistemmsn
Copy link

Before you start please confirm the following.

Problem Description

Install portainer version CE 2.19.5 and when I want to see the containers it fails out of nowhere, I already tried 3 versions ago and nothing

image

Expected Behavior

See the containers but it gives an error
image
As soon as you click it it goes down

Actual Behavior

These are the errors it gives
2024/05/31 10:33:32 server: Reverse tunnelling enabled 2024/05/31 10:33:32 server: Fingerprint Uh9Fiqey2Vz+eyPQHOw0uUVttQ61aorMzNLkMntHH2w= 2024/05/31 10:33:32 server: Listening on http://0.0.0.0:8000 2024/05/31 10:33AM WRN github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" 2024/05/31 10:33AM INF github.com/portainer/portainer/api/cmd/portainer/main.go:649 > starting Portainer | build_number=64 go_version=1.21.9 image_tag=linux-amd64-2.19.5 nodejs_version=18.20.2 version=2.19.5 webpack_version=5.88.1 yarn_version=1.22.22 2024/05/31 10:33AM INF github.com/portainer/portainer/api/http/server.go:357 > starting HTTPS server | bind_address=:9443 2024/05/31 10:33AM INF github.com/portainer/portainer/api/http/server.go:341 > starting HTTP server | bind_address=:9000 2024/05/31 10:35AM WRN github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" 2024/05/31 10:35AM WRN github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" 2024/05/31 10:35AM WRN github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" 2024/05/31 10:37AM WRN github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" 2024/05/31 10:41AM WRN github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" 2024/05/31 10:41AM WRN github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" 2024/05/31 10:41AM WRN github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" 2024/05/31 10:42AM WRN github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" 2024/05/31 10:42AM WRN github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" 2024/05/31 10:42AM WRN github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" 2024/05/31 10:42AM WRN github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" 2024/05/31 10:43AM WRN github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"

Steps to Reproduce

`services:

portainer:
image: portainer/portainer-ce:latest
command: -H unix://run/docker.sock
container_name: portainer
restart: always
volumes:
- /etc/localtime:/etc/localtime:ro
- /run/docker.sock:/run/docker.sock:ro
- portainer_data:/data
networks:
- proxy

volumes:
portainer_data:

networks:
proxy:
external: true`

This is the operating system version

image

docker version

image

Portainer logs or screenshots

Not even version 2.20.3 works

Portainer version

2.19.5

Portainer Edition

Business Edition (BE/EE) with 5NF / 3NF license

Platform and Version

26.1.3

OS and Architecture

debian 12

Browser

No response

What command did you use to deploy Portainer?

`services:

 portainer:
    image: portainer/portainer-ce:latest
    command: -H unix://run/docker.sock
    container_name: portainer
    restart: always
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /run/docker.sock:/run/docker.sock:ro
      - portainer_data:/data
    networks:
     - proxy 

volumes:
    portainer_data:

networks:
  proxy:
    external: true`

Additional Information

No response

@sistemmsn
Copy link
Author

image

@jamescarppe
Copy link
Member

In your steps to reproduce you have the following for your socket volume:

- /run/docker.sock:/run/docker.sock:ro

Portainer internally expects the socket to be at /var/run/docker.sock and the above exposes it as /run/docker.sock within the container. If on your host environment the Docker socket is at /run/docker.sock you can use the following:

- /run/docker.sock:/var/run/docker.sock:ro

If on the host it is at /var/run/docker.sock then you should use:

- /var/run/docker.sock:/var/run/docker.sock:ro

@sistemmsn
Copy link
Author

I made the requested change but it didn't work, the container dies, this route should be dynamic without having to

image

`services:

portainer:
image: portainer/portainer-ce:latest
command: -H unix://run/docker.sock
container_name: portainer
restart: always
volumes:
- /etc/localtime:/etc/localtime:ro
- /run/docker.sock:/var/run/docker.sock:ro
- portainer_data:/data
networks:
- proxy

volumes:
portainer_data:

networks:
proxy:
external: true`

It's strange because in the routes of both /var/run and /run I have the docker.socket, but I know what gives the info is /run/docker.socket because I'm using homepage https://gethomepage.dev/latest/ and I brings the status of my containers

image
image

@jamescarppe
Copy link
Member

My apologies, you'll need to change the command line as well - I missed this in your initial post. You should also have three slashes after unix: in the command line rather than just two.

From:

command: -H unix://run/docker.sock

to:

command: -H unix:///var/run/docker.sock

@sistemmsn
Copy link
Author

`services:

portainer:
image: portainer/portainer-ce:latest
command: -H unix:///var/run/docker.sock
container_name: portainer
restart: always
volumes:
- /etc/localtime:/etc/localtime:ro
- /run/docker.sock:/var/run/docker.sock:ro
- portainer_data:/data
networks:
- proxy

volumes:
portainer_data:

networks:
proxy:
external: true`

image

When I restart the container it appears up, but when I click on it out of nowhere it changes to down
image

image

@jamescarppe
Copy link
Member

Is there any more detail from the "Environment is unreachable" error, perhaps in the browser's dev console?

Can you try it without mounting the socket as read-only (just to eliminate that as an issue)?

@sistemmsn
Copy link
Author

It doesn't stay the same, I test in Edge, Firefox, Chrome and it gives the same result, there is some variable to activate a debug to see more logs because the logs it gives are very superficial, I think it will be more of a Debian 12 OS issue

@binaryYuki
Copy link

binaryYuki commented Jul 20, 2024

Hi @jamescarppe ,

I met the same problem today and it took me several hours to try to solve it. But ...

The error appears as:

portainer_portainer.1.tgvahuj6gtkt@managera1    | 2024/07/20 10:38AM INF github.com/portainer/portainer/api/cmd/portainer/main.go:369 > encryption key file not present | filename=portainer
portainer_portainer.1.tgvahuj6gtkt@managera1    | 2024/07/20 10:38AM INF github.com/portainer/portainer/api/cmd/portainer/main.go:392 > proceeding without encryption key |
portainer_portainer.1.tgvahuj6gtkt@managera1    | 2024/07/20 10:38AM INF github.com/portainer/portainer/api/database/boltdb/db.go:125 > loading PortainerDB | filename=portainer.db
portainer_portainer.1.tgvahuj6gtkt@managera1    | 2024/07/20 10:38AM INF github.com/portainer/portainer/api/chisel/service.go:198 > Found Chisel private key file on disk | private-key=/data/chisel/private-key.pem
portainer_portainer.1.tgvahuj6gtkt@managera1    | 2024/07/20 10:38:18 server: Reverse tunnelling enabled
portainer_portainer.1.tgvahuj6gtkt@managera1    | 2024/07/20 10:38:18 server: Fingerprint Rq7Fs+/b98YzIzjFdNB/i8zj3QflFzanr6EzT+ewJaw=
portainer_portainer.1.tgvahuj6gtkt@managera1    | 2024/07/20 10:38:18 server: Listening on http://0.0.0.0:8000
portainer_portainer.1.tgvahuj6gtkt@managera1    | 2024/07/20 10:38AM WRN github.com/portainer/portainer/api/platform/platform.go:70 > failed to retrieve docker info | error="Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"
portainer_portainer.1.tgvahuj6gtkt@managera1    | 2024/07/20 10:38AM INF github.com/portainer/portainer/api/cmd/portainer/main.go:649 > starting Portainer | build_number=64 go_version=1.21.9 image_tag=linux-arm64-2.19.5 nodejs_version=18.20.2 version=2.19.5 webpack_version=5.88.1 yarn_version=1.22.22
portainer_portainer.1.tgvahuj6gtkt@managera1    | 2024/07/20 10:38AM INF github.com/portainer/portainer/api/http/server.go:357 > starting HTTPS server | bind_address=:9443
portainer_portainer.1.tgvahuj6gtkt@managera1    | 2024/07/20 10:38AM INF github.com/portainer/portainer/api/http/server.go:341 > starting HTTP server | bind_address=:9000
portainer_portainer.1.tgvahuj6gtkt@managera1    | 2024/07/20 10:43AM INF github.com/portainer/portainer/api/adminmonitor/admin_monitor.go:62 > the Portainer instance timed out for security purposes, to re-enable your Portainer instance, you will need to restart Portainer |

My Docker Service :

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target docker.socket firewalld.service containerd.service time-set.target
Wants=network-online.target containerd.service
Requires=docker.socket

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutStartSec=0
RestartSec=2
Restart=always

# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst=3

# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
# this option work for either version of systemd.
StartLimitInterval=60s

# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity

# Comment TasksMax if your systemd version does not support it.
# Only systemd 226 and above support this option.
TasksMax=infinity

# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes

# kill only the docker process, not all processes in the cgroup
KillMode=process
OOMScoreAdjust=-500

[Install]
WantedBy=multi-user.target

Deployment via docker stack:

version: '3.2'

services:
  agent:
    image: portainer/agent:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/lib/docker/volumes:/var/lib/docker/volumes
    networks:
      - agent_network
    deploy:
      mode: global
      placement:
        constraints: [node.platform.os == linux]

  portainer:
    image: portainer/portainer-ce:2.19.5
    command: -H tcp://tasks.agent:9001 --tlsskipverify
    volumes:
      - portainer_data:/data
    networks:
      - agent_network
      - traefik-net
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints: [node.role == manager]
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.portainer.rule=Host(`panel.tzpro.xyz`)"
        - "traefik.http.routers.portainer.entrypoints=websecure"
        - "traefik.http.routers.portainer.tls.certresolver=le"
        - "traefik.http.services.portainer.loadbalancer.server.port=9000"


networks:
  agent_network:
    driver: overlay
    attachable: true
  traefik-net:
    driver: overlay
    external: true

volumes:
  portainer_data:

Are there any resolutions?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants