Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
- [x] This is a bug report
- [ ] This is a feature request
- [x] I searched existing issues before opening this one
Expected behavior
Correct command execution sudo docker info
Actual behavior
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?`
More info
sudo service docker start
A dependency job for docker.service failed. See 'journalctl -xe' for details.
Journal output:
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is dependency.
Dec 25 08:49:24 REDACTED systemd[1]: docker.service: Job docker.service/start failed with result 'dependenc
Dec 25 08:49:24 REDACTED systemd[1]: containerd.service: Unit entered failed state.
Dec 25 08:49:24 REDACTED systemd[1]: containerd.service: Failed with result 'exit-code'.
Dec 25 08:49:24 REDACTED sudo[10258]: pam_unix(sudo:session): session closed for user root
Dec 25 08:49:24 REDACTED systemd[1]: Stopped Docker Application Container Engine.
-- Subject: Unit docker.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has finished shutting down.
Dec 25 08:50:48 REDACTED sshd[10289]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tt
Dec 25 08:50:49 REDACTED sshd[10289]: Failed password for mail from 200.90.11.218 port 17362 ssh2
Dec 25 08:50:49 REDACTED sshd[10289]: Received disconnect from 200.90.11.218 port 17362:11: Bye Bye [preaut
Dec 25 08:50:49 REDACTED sshd[10289]: Disconnected from 200.90.11.218 port 17362 [preauth]
Dec 25 08:51:10 REDACTED sudo[10292]: fp : TTY=pts/0 ; PWD=/home/REDACTED ; USER=root ; COMMAND=/bin/journa
Dec 25 08:51:10 REDACTED sudo[10292]: pam_unix(sudo:session): session opened for user root by REDACTED(uid=0)
Output of docker version:
Client:
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:48:57 2018
OS/Arch: linux/amd64
Experimental: false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Output of docker info:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Additional environment details (AWS, VirtualBox, physical, etc.) OS info:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial
I'm using VPS
Same problem with the same configuration.
#476
#476
I tried everything from that issue - nothing helps(((
Can you look at journalctl -fu docker?
as suggestest in the other issue, try to downgrade and better wait for the next version. the previous version works fine, if not sth at your config seems wrong and u need to debug it by reading the logs.
@cpuguy83
-- Logs begin at Sat 2019-01-05 19:31:08 UTC. --
Jan 08 10:38:11 185-20-227-19 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Jan 08 10:38:11 185-20-227-19 systemd[1]: Failed to start Docker Application Container Engine.
Jan 08 10:38:11 185-20-227-19 systemd[1]: docker.service: Unit entered failed state.
Jan 08 10:38:11 185-20-227-19 systemd[1]: docker.service: Failed with result 'exit-code'.
Jan 08 10:38:11 185-20-227-19 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jan 08 10:38:11 185-20-227-19 systemd[1]: Stopped Docker Application Container Engine.
Jan 08 10:38:11 185-20-227-19 systemd[1]: docker.service: Start request repeated too quickly.
Jan 08 10:38:11 185-20-227-19 systemd[1]: Failed to start Docker Application Container Engine.
Jan 08 10:38:11 185-20-227-19 systemd[1]: docker.service: Unit entered failed state.
Jan 08 10:38:11 185-20-227-19 systemd[1]: docker.service: Failed with result 'start-limit-hit'.
Sorry, this does not look like the logs from journalctl -fu docker. Can you confirm the exact command you are running?
@cpuguy83
REDACTED@REDACTED:~$ sudo journalctl -fu docker
[sudo] password for REDACTED:
-- Logs begin at Mon 2019-01-07 03:12:50 UTC. --
Jan 08 10:38:11 185-20-227-19 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Jan 08 10:38:11 185-20-227-19 systemd[1]: Failed to start Docker Application Container Engine.
Jan 08 10:38:11 185-20-227-19 systemd[1]: docker.service: Unit entered failed state.
Jan 08 10:38:11 185-20-227-19 systemd[1]: docker.service: Failed with result 'exit-code'.
Jan 08 10:38:11 185-20-227-19 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jan 08 10:38:11 185-20-227-19 systemd[1]: Stopped Docker Application Container Engine.
Jan 08 10:38:11 185-20-227-19 systemd[1]: docker.service: Start request repeated too quickly.
Jan 08 10:38:11 185-20-227-19 systemd[1]: Failed to start Docker Application Container Engine.
Jan 08 10:38:11 185-20-227-19 systemd[1]: docker.service: Unit entered failed state.
Jan 08 10:38:11 185-20-227-19 systemd[1]: docker.service: Failed with result 'start-limit-hit'.
@fpavlik Ok, seems like this may be the missing .socket file.
@cpuguy83 and what i need to do?
You can either put the socket back in place (18.09.0 incorrectly removed it), here's the file: https://github.com/docker/docker-ce/blob/18.06/components/packaging/deb/systemd/docker.socket
Or you can remove -H fd:// from the docker.service file.
@cpuguy83 at first i copied docker.socket to the /var/run - its not help
Next step i tried to find docker.service with the command $ find docker.service - and there is no such file(((
where is my mistake?
Should be something like /lib/systemd/system/, but depends on your distro.
Docker 18.09.1 should be available now
@cpuguy83 @thaJeztah Oh, i reinstalled docker, now i have 18.09.1, after reinstal it still not works. Next step i found docker.service in /lib/systemd/system and cut -H fd://, then i reload with systemct daemon-reload and nothing helps.
@fpavlik what do systemctl cat docker.service and systemctl cat containerd.service show?
@thaJeztah
# /lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
BindsTo=containerd.service
After=network-online.target firewalld.service
Wants=network-online.target
Requires=docker.socket
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate iss
# exists and systemd currently does not support the cgroup feature set r
# for containers run by docker
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always
# Note that StartLimit* options were moved from "Service" to "Unit" in s
# Both the old, and new location are accepted by systemd 229 and up, so
# to make them work for either version of systemd.
and
# /lib/systemd/system/containerd.service
[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=network.target
[Service]
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/bin/containerd
KillMode=process
Delegate=yes
LimitNOFILE=1048576
# Having non-zero Limit*s causes performance problems due to accounting
# in the kernel. We recommend using cgroups to do container-local accoun
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
[Install]
WantedBy=multi-user.target
lines 1-20/20 (END)
@cpuguy83 in which place i have to put docker.socket?
Well, I'm using Ubuntu 18.04 and it randomly happened with me. I decided to install a newer version of docker following the official guide: https://docs.docker.com/install/linux/docker-ce/ubuntu/
And now it works without even restart the machine.
@fpavlik If you install the latest package you should automatically get the docker.socket