for-linux
for-linux copied to clipboard
Docker-ce fails to install in Debian GNU/Linux 10
- [x] This is a bug report
- [ ] This is a feature request
- [x] I searched existing issues before opening this one
Expected behavior
apt install docker-ce docker-ce-cli containerd.io
Actual behavior
Installation fails with this apt report:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
aufs-dkms aufs-tools cgroupfs-mount dkms linux-headers-amd64
Suggested packages:
aufs-dev python3-apport menu
The following NEW packages will be installed:
aufs-dkms aufs-tools cgroupfs-mount containerd.io dkms docker-ce docker-ce-cli linux-headers-amd64
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/88.1 MB of archives.
After this operation, 391 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package dkms.
(Reading database ... 92733 files and directories currently installed.)
Preparing to unpack .../0-dkms_2.6.1-4_all.deb ...
Unpacking dkms (2.6.1-4) ...
Selecting previously unselected package aufs-dkms.
Preparing to unpack .../1-aufs-dkms_4.19+20190211-1_all.deb ...
Unpacking aufs-dkms (4.19+20190211-1) ...
Selecting previously unselected package aufs-tools.
Preparing to unpack .../2-aufs-tools_1%3a4.14+20190211-1_amd64.deb ...
Unpacking aufs-tools (1:4.14+20190211-1) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../3-cgroupfs-mount_1.4_all.deb ...
Unpacking cgroupfs-mount (1.4) ...
Selecting previously unselected package containerd.io.
Preparing to unpack .../4-containerd.io_1.2.6-3_amd64.deb ...
Unpacking containerd.io (1.2.6-3) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../5-docker-ce-cli_5%3a19.03.1~3-0~debian-buster_amd64.deb ...
Unpacking docker-ce-cli (5:19.03.1~3-0~debian-buster) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../6-docker-ce_5%3a19.03.1~3-0~debian-buster_amd64.deb ...
Unpacking docker-ce (5:19.03.1~3-0~debian-buster) ...
Selecting previously unselected package linux-headers-amd64.
Preparing to unpack .../7-linux-headers-amd64_4.19+105_amd64.deb ...
Unpacking linux-headers-amd64 (4.19+105) ...
Setting up aufs-tools (1:4.14+20190211-1) ...
Setting up linux-headers-amd64 (4.19+105) ...
Setting up dkms (2.6.1-4) ...
Setting up containerd.io (1.2.6-3) ...
Created symlink /etc/systemd/system/multi-user.target.wants/containerd.service → /lib/systemd/system/containerd.service.
Setting up docker-ce-cli (5:19.03.1~3-0~debian-buster) ...
Setting up aufs-dkms (4.19+20190211-1) ...
Loading new aufs-4.19+20190211 DKMS files...
Building for 4.19.0-5-amd64
Building initial module for 4.19.0-5-amd64
Done.
aufs.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.19.0-5-amd64/updates/dkms/
depmod...
DKMS: install completed.
Setting up cgroupfs-mount (1.4) ...
Setting up docker-ce (5:19.03.1~3-0~debian-buster) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Wed 2019-08-28 15:54:10 MSK; 4ms ago
Docs: https://docs.docker.com
Process: 15302 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 15302 (code=exited, status=1/FAILURE)
dpkg: error processing package docker-ce (--configure):
installed docker-ce package post-installation script subprocess returned error exit status 1
Processing triggers for systemd (241-5) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10) ...
Errors were encountered while processing:
docker-ce
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
Steps to reproduce the behavior
Output of docker version
:
Client: Docker Engine - Community
Version: 19.03.1
API version: 1.40
Go version: go1.12.5
Git commit: 74b1e89
Built: Thu Jul 25 21:21:24 2019
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
:
Client: Docker Engine - Community
Version: 19.03.1
API version: 1.40
Go version: go1.12.5
Git commit: 74b1e89
Built: Thu Jul 25 21:21:24 2019
OS/Arch: linux/amd64
Experimental: false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
root@blackhole:/home/zanyxdev# ^C
root@blackhole:/home/zanyxdev# docker info
Client:
Debug Mode: false
Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info
Output of cat /etc/issue
:
Debian GNU/Linux 10
Output of uname -a
:
Linux blackhole 4.19.0-5-amd64 #1 SMP Debian 4.19.37-5+deb10u2 (2019-08-08) x86_64 GNU/Linux
Output of # cat /etc/default/grub
:
GRUB_CMDLINE_LINUX_DEFAULT="zswap.enabled=1 zswap.max_pool_percent=25 zswap.compressor=lz4 quiet"
Additional environment details (AWS, VirtualBox, physical, etc.)
Test run docker run hello-world
docker: error during connect: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: read unix @->/var/run/docker.sock: read: connection reset by peer.
See 'docker run --help'.
i'm find error. if first run docker engine run service opevnp result fail, but if ` `` systemctl stop openvpn-client@dev-vm systemctl restart docker.service systemctl start openvpn-client@dev-vm
all success
I can confirm this on a fresh Debian 10 install (and confirm the workaround of shutting down openvpn)
That's quite strange. Is there something in the docker daemon logs?
Can you check the logs for the docker daemon? (something like journalctl -xu docker
). Is it possible that OpenVPN reserves all ip-ranges, and therefore the docker daemon is unable to pick a suitable range for its internal networks? See https://github.com/docker/for-linux/issues/1050#issuecomment-651185709
Given that by default, docker has socket-activation enabled, it's possible that docker run hello-world
tries to connect to the /var/run/docker.sock
socket, which will trigger socket activation (which tries to start the daemon), then (because of the problem above), the daemon fails to start, causing the socket connection to be closed, which is shown as read: connection reset by peer
I got the very same issue trying to install on a gcp compute engine . journactl -u docker shows :
Oct 20 11:14:16 x systemd[1]: Starting Docker Application Container Engine...
Oct 20 11:14:16 x dockerd[4693]: time="2020-10-20T11:14:16.869810821Z" level=info msg="Starting up"
Oct 20 11:14:16 x dockerd[4693]: failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd
Oct 20 11:14:16 x systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Oct 20 11:14:16 x systemd[1]: docker.service: Failed with result 'exit-code'.
Oct 20 11:14:16 x systemd[1]: Failed to start Docker Application Container Engine.
Oct 20 11:14:18 x systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.
Oct 20 11:14:18 x systemd[1]: docker.service: Scheduled restart job, restart counter is at 1.
Oct 20 11:14:18 x systemd[1]: Stopped Docker Application Container Engine.
Oct 20 11:14:18 x systemd[1]: Starting Docker Application Container Engine...
Oct 20 11:14:19 x dockerd[5328]: time="2020-10-20T11:14:19.004023961Z" level=info msg="Starting up"
And if I look installation output, I can see:
Starting Docker Application Container Engine...
[FAILED] Failed to start Docker Application Container Engine.
Failed to start Docker Application Container Engine.
[ OK ] Stopped Docker Application Container Engine.
Starting Docker Socket for the API.
Oct 20 11:14:18 x systemd[1]: Stopped Docker Application Container Engine.
Oct 20 11:14:18 x systemd[1]: Starting Docker Socket for the API.
[ OK ] Listening on Docker Socket for the API.
Starting Docker Application Container Engine...
Oct 20 11:14:18 x systemd[1]: Listening on Docker Socket for the API.
Oct 20 11:14:18 x systemd[1]: Starting Docker Application Container Engine...
[ OK ] Started Docker Application Container Engine.
If these are unattended / non-interactive installs, I wonder if it's related to https://github.com/docker/docker-ce-packaging/pull/331 / https://github.com/docker/docker-ce-packaging/pull/486
might be, as I'm installing through metadata.startup_script (non interactive script running at compute startup).
If I comment apt install
and do it by hand, everything works correctly
updating to debian 11 solved this for me.
I was having the same problem due to not rebooting after a system upgrade.