docker / for-linux

Docker Engine for Linux
https://docs.docker.com/engine/installation/
755 stars 85 forks source link

systemd "docker.socket" missing on todays update #476

Closed cultcom closed 5 years ago

cultcom commented 5 years ago

Expected behavior

Upgrade to 18.09.0~3-0~debian-stretch works painlessley.

Actual behavior

Upgrade to 18.09.0~3-0~debian-stretch removes the file /lib/systemd/system/docker.socket and does not restart after the upgrade.

Steps to reproduce the behavior

Run apt-get dist-upgrade on a Debian stretch system with an older docker-ce package installed.

thaJeztah commented 4 years ago

Hm, possibly yes. I haven't seen the problem occur in manual installs.

I did find some discussion around a similar issue with CUPS, but at a glance, they "solved" it by not installing socket activation 🤔 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747073

superdit commented 4 years ago

same problem here on fresh install ubuntu 20.04,

sudo apt install docker-ce Reading package lists... Done Building dependency tree
Reading state information... Done docker-ce is already the newest version (5:19.03.12~3-0~ubuntu-focal). 0 upgraded, 0 newly installed, 0 to remove and 238 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y Setting up docker-ce (5:19.03.12~3-0~ubuntu-focal) ... 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 Sun 2020-07-12 06:21:03 WIB; 6ms ago TriggeredBy: ● docker.socket Docs: https://docs.docker.com Process: 43319 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE) Main PID: 43319 (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 Errors were encountered while processing: docker-ce E: Sub-process /usr/bin/dpkg returned an error code (1)

I have solved in my machine : I need to turn off my vpn first https://forums.docker.com/t/subprocess-installed-post-installation-script-returned-error-exit-status-1/37444/4

cgd1 commented 4 years ago

I Googled for a while, only to find StackOverflow questions and Docker Forums posts with no answers.

It looks like installing Docker CE on a fresh Ubuntu Server install (20.04 LTS) isn't working properly due to the same issue as here.

Jul  9 06:37:35 ubuntuguest dockerd[2752]: time="2020-07-09T06:37:35.718960835Z" level=info msg="Starting up"
Jul  9 06:37:35 ubuntuguest dockerd[2752]: failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd
Jul  9 06:37:35 ubuntuguest systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Jul  9 06:37:35 ubuntuguest systemd[1]: docker.service: Failed with result 'exit-code'.
Jul  9 06:37:35 ubuntuguest systemd[1]: Failed to start Docker Application Container Engine.

I've checked, and the installed version seemed to be the latest stable available.

docker-ce:
  Installed: 5:19.03.12~3-0~ubuntu-focal
  Candidate: 5:19.03.12~3-0~ubuntu-focal

The error prevents the whole apt install command from finishing successfully:

Setting up docker-ce (5:19.03.12~3-0~ubuntu-focal) ...
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 Thu 2020-07-09 06:37:35 UTC; 4ms ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
    Process: 2752 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 2752 (code=exited, status=1/FAILURE)

Jul 09 06:37:35 ubuntuguest systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Jul 09 06:37:35 ubuntuguest systemd[1]: docker.service: Failed with result 'exit-code'.
Jul 09 06:37:35 ubuntuguest systemd[1]: Failed to start Docker Application Container Engine.
dpkg: error processing package docker-ce (--configure):
 installed docker-ce package post-installation script subprocess returned error exit status 1

Edit: it seems similar to #989, but it never was resolved

Same problem on fresh Ubuntu Server install (20.04 LTS)

@ptrcnull did you manage to solve issue? I can work around it but its really annoying that containers wont restart on host machine reboot :( !

@thaJeztah not sure if my 2cents helps, I used a simple install script to add docker and other dependencies on host machine.

ptrcnull commented 4 years ago

@cgd1 I ended up installing docker.io from Ubuntu repositories, it may be older but at least doesn't fail on install

rubemfsv commented 4 years ago

I confirm also in ubuntu.

apt purge --auto-remove docker-ce
apt install docker-ce=18.06.1~ce~3-0~ubuntu

does the trick. however, i digged into this and :

xxx systemd[1]: Starting containerd container runtime...
xxx systemd[1]: Starting Docker Application Container Engine...
xxx modprobe[13353]: modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.110-x86_64-jb1/modules.dep.bin'
xxx modprobe[13353]: modprobe: FATAL: Module overlay not found in directory /lib/modules/4.4.110-x86_64-jb1
xxx systemd[1]: containerd.service: Control process exited, code=exited status=1
xxx systemd[1]: containerd.service: Failed with result 'exit-code'.
xxx systemd[1]: Failed to start containerd container runtime.
xxx systemd[1]: Dependency failed for Docker Application Container Engine.
xxx systemd[1]: docker.service: Job docker.service/start failed with result 'dependency'.
xxx systemd[1]: Stopped Docker Application Container Engine.

Worked for me with no error.

cgd1 commented 4 years ago

@cgd1 I ended up installing docker.io from Ubuntu repositories, it may be older but at least doesn't fail on install

A thousand thank you's !! :1st_place_medal:

cgd1 commented 4 years ago

interesting... I actually had docker.io installed.

still experiencing issue