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

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

Closed
1 of 3 tasks
cultcom opened this issue Nov 8, 2018 · 57 comments
Closed
1 of 3 tasks

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

cultcom opened this issue Nov 8, 2018 · 57 comments

Comments

@cultcom
Copy link

cultcom commented Nov 8, 2018

  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

Upgrade to 18.09.03-0debian-stretch works painlessley.

Actual behavior

Upgrade to 18.09.03-0debian-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.

@Val
Copy link

Val commented Nov 8, 2018

I confirm.

Downgrading back manually by downloading 18.06.1ce3-0~debian is a temporary workaround.
But not very useful for devOps :-/

apt remove --purge containerd.io docker-ce docker-ce-cli
wget https://download.docker.com/linux/debian/dists/stretch/pool/stable/amd64/docker-ce_18.06.1~ce~3-0~debian_amd64.deb
dpkg -i docker-ce_18.06.1~ce~3-0~debian_amd64.deb

@volkovmqx
Copy link

volkovmqx commented Nov 8, 2018

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.

@thaJeztah
Copy link
Member

Also reported in moby/moby#38119

@akanass
Copy link

akanass commented Nov 8, 2018

Same problem for me:


$ docker version

Client:
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:49:01 2018
OS/Arch: linux/amd64
Experimental: false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?


$ systemctl status docker.service

● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/docker.service.d
└─override.conf
Active: failed (Result: exit-code) since Thu 2018-11-08 21:13:33 CET; 22min ago
Docs: https://docs.docker.com
Process: 2801 ExecStart=/usr/bin/dockerd -H fd:// --live-restore (code=exited, status=1/FAILURE)
Main PID: 2801 (code=exited, status=1/FAILURE)



$ journalctl -x

-- Unit docker.service has begun starting up.
Nov 08 21:40:31 ns538586.ip-158-69-247.net dockerd[4534]: Failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd
Nov 08 21:40:31 ns538586.ip-158-69-247.net systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Nov 08 21:40:31 ns538586.ip-158-69-247.net systemd[1]: docker.service: Failed with result 'exit-code'.
Nov 08 21:40:31 ns538586.ip-158-69-247.net systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd

Downgrade to docker-ce=18.06.1~ce~3-0~ubuntu works for me too

@reloxx13
Copy link

reloxx13 commented Nov 8, 2018

on my rasbian i could not start docker after the update.

journalctl -fu docker
-- Logs begin at Thu 2018-11-08 21:09:34 CET. --
Nov 08 21:12:18 Pi3B-01 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Nov 08 21:12:18 Pi3B-01 systemd[1]: Failed to start Docker Application Container Engine.
Nov 08 21:12:18 Pi3B-01 systemd[1]: docker.service: Unit entered failed state.
Nov 08 21:12:18 Pi3B-01 systemd[1]: docker.service: Failed with result 'exit-code'.
Nov 08 21:12:21 Pi3B-01 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Nov 08 21:12:21 Pi3B-01 systemd[1]: Stopped Docker Application Container Engine.
Nov 08 21:12:21 Pi3B-01 systemd[1]: docker.service: Start request repeated too quickly.
Nov 08 21:12:21 Pi3B-01 systemd[1]: Failed to start Docker Application Container Engine.
Nov 08 21:12:21 Pi3B-01 systemd[1]: docker.service: Unit entered failed state.
Nov 08 21:12:21 Pi3B-01 systemd[1]: docker.service: Failed with result 'exit-code'.

i found out that i had a new file in /systemd/system/docker.service.d/override.conf
(i backup my /etc folder, so i can see that this file did not exist yesterday)

with this content:

# /etc/systemd/system/docker.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375
sudo systemctl daemon-reload
sudo systemctl restart docker.service

so wtf i dont know where this file came from, but this is a loop.

but even if i remove the last 2 lines i cannot start docker.
i can start again after removing -H fd://, but this kills docker ps etc.

Nov 08 22:04:44 Pi3B-01 sudo[12431]:       pi : TTY=pts/1 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/systemctl start docker
Nov 08 22:04:44 Pi3B-01 sudo[12431]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Nov 08 22:04:44 Pi3B-01 systemd[1]: docker.service: Start request repeated too quickly.
Nov 08 22:04:44 Pi3B-01 systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit docker.service has failed.
--
-- The result is failed.
Nov 08 22:04:44 Pi3B-01 systemd[1]: docker.service: Failed with result 'exit-code'.

can also confirm that /lib/systemd/system/docker.socket is missing.

somewhere in the logs i also read that unix did not get detected, instead it was sth with rtcp or similar, cannot find and remember it :S

moby/moby#22847 (comment) #162 moby/moby#22847 (comment)

@mcandre
Copy link

mcandre commented Nov 8, 2018

Maybe include systemd integration tests before releasing a new version?

@thaJeztah
Copy link
Member

Maybe include systemd integration tests before releasing a new version?

There's tests for this, but unfortunately, the problem with the daemon failing to start won't manifest it self on a fresh install, and only will only be an issue if;

  1. the dockerd systemd unit has been modified by the user. If the unit file is modified, it won't be updated with the latest version that ships with the rpm/deb package (rpm/deb will detect it's modified and will leave it untouched); never modify the systemd unit file itself, but use a "drop-in" file (override file) to customise the unit file. However;
  2. if you used a systemd drop-in file, and that file has an ExecStart with dockerd -H fd://, the service will fail to start, as it won't be able to connect to a socket created by systemd.

If you're in situation 1.;

The unmodified systemd unit file that ships with Docker 18.09.0 can be found here; https://github.com/docker/docker-ce/blob/v18.09.0/components/packaging/systemd/docker.service

If you're in situation 2.:

If you need socket activation; restore the docker.socket unit-file from the 18.06 release; https://github.com/docker/docker-ce/blob/18.06/components/packaging/deb/systemd/docker.socket

If you don't need socket activation; either:

  • remove the -H fd:// from the ExecStart (if you don't have other -H options set)
  • change to -H unix:// instead.

Work is in progress to add back socket activation (see
docker/docker-ce-packaging#257), which will be either in an upcoming patch release, or in a package update.

@volkovmqx
Copy link

There's tests for this, but unfortunately, the problem with the daemon failing to start won't manifest it self on a fresh install, and only will only be an issue if;

i don't have any custom config files and it still fails. maybe also add this test case to your testsuite? install previous version and upgrade.

@thaJeztah
Copy link
Member

Trying to reproduce, but it seems to work for me (Ubuntu 16.04 in this case);

Version installed before upgrading;

docker version
Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:24:56 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:23:21 2018
  OS/Arch:          linux/amd64
  Experimental:     false

Check the service's unit-file for modifications (and/or show overrides/drop-ins);

systemctl cat docker.service

# /lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target docker.socket firewalld.service
Wants=network-online.target
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://
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
# 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
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
TasksMax=infinity
TimeoutStartSec=0
# 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
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target

Update docker;

apt-get update && apt-get install docker-ce
Hit:2 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:1 http://lon1.mirrors.digitalocean.com/ubuntu xenial InRelease                              
Hit:3 http://lon1.mirrors.digitalocean.com/ubuntu xenial-updates InRelease                      
Hit:4 https://repos.sonar.digitalocean.com/apt main InRelease
Hit:5 https://download.docker.com/linux/ubuntu xenial InRelease
Hit:6 http://lon1.mirrors.digitalocean.com/ubuntu xenial-backports InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-134 linux-headers-4.4.0-134-generic linux-image-4.4.0-134-generic
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  containerd.io docker-ce-cli
The following NEW packages will be installed:
  containerd.io docker-ce-cli
The following packages will be upgraded:
  docker-ce
1 upgraded, 2 newly installed, 0 to remove and 26 not upgraded.
Need to get 50.2 MB of archives.
After this operation, 44.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://download.docker.com/linux/ubuntu xenial/stable amd64 containerd.io amd64 1.2.0-1 [19.9 MB]
Get:2 https://download.docker.com/linux/ubuntu xenial/stable amd64 docker-ce amd64 5:18.09.0~3-0~ubuntu-xenial [17.4 MB]
Get:3 https://download.docker.com/linux/ubuntu xenial/stable amd64 docker-ce-cli amd64 5:18.09.0~3-0~ubuntu-xenial [13.0 MB]
Fetched 50.2 MB in 1s (32.8 MB/s)   
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_CTYPE 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 containerd.io.
(Reading database ... 138271 files and directories currently installed.)
Preparing to unpack .../containerd.io_1.2.0-1_amd64.deb ...
Unpacking containerd.io (1.2.0-1) ...
Preparing to unpack .../docker-ce_5%3a18.09.0~3-0~ubuntu-xenial_amd64.deb ...
Unpacking docker-ce (5:18.09.0~3-0~ubuntu-xenial) over (18.06.1~ce~3-0~ubuntu) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../docker-ce-cli_5%3a18.09.0~3-0~ubuntu-xenial_amd64.deb ...
Unpacking docker-ce-cli (5:18.09.0~3-0~ubuntu-xenial) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up containerd.io (1.2.0-1) ...
Setting up docker-ce-cli (5:18.09.0~3-0~ubuntu-xenial) ...
Setting up docker-ce (5:18.09.0~3-0~ubuntu-xenial) ...
update-alternatives: using /usr/bin/dockerd-ce to provide /usr/bin/dockerd (dockerd) in auto mode

Verify that it's upgraded, and started;

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

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:16:44 2018
  OS/Arch:          linux/amd64
  Experimental:     false

@reloxx13
Copy link

reloxx13 commented Nov 9, 2018

/lib/systemd/system/docker.service looks exact the same like from your link ( https://github.com/docker/docker-ce/blob/v18.09.0/components/packaging/systemd/docker.service )

-H unix:// still shows same error as above

placed docker.socket in /lib/systemd/system, still same error

now i saw that /var/run/docker.sock is a folder?!

drwx------  8 root        root         160 Nov  9 17:22 docker
drwxr-xr-x  2 root        root          40 Nov  8 22:50 docker.sock

@mwuttke
Copy link

mwuttke commented Nov 9, 2018

@reloxx13: Please run

systemctl deamon-reload

on a debian stretch system after you placed the docker.socket file int the folder /lib/systemd/system. After that you can run

systemctl restart docker.service

@reloxx13
Copy link

reloxx13 commented Nov 9, 2018

nope, wont start :/

sudo /usr/bin/dockerd
Failed to load listeners: can't create unix socket /var/run/docker.sock: is a directory

after some googling (moby/moby#30348) i moved the folder away and now docker starts again 👍

My workaround for Rasbian;

sudo curl https://raw.githubusercontent.com/docker/docker-ce-packaging/master/systemd/docker.socket -o /lib/systemd/system/docker.socket

check if file exists, only if exists check the content, has to be this:
( sudo systemctl edit docker.service )

# /etc/systemd/system/docker.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H unix:// -H tcp://127.0.0.1:2375

sudo systemctl daemon-reload

sudo systemctl restart docker.service

if docker started, remove rm -rf /var/run/docker.sock.bk

@volkovmqx
Copy link

Trying to reproduce, but it seems to work for me (Ubuntu 16.04 in this case);

Version installed before upgrading;

docker version
Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:24:56 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:23:21 2018
  OS/Arch:          linux/amd64
  Experimental:     false

Check the service's unit-file for modifications (and/or show overrides/drop-ins);

systemctl cat docker.service

# /lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target docker.socket firewalld.service
Wants=network-online.target
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://
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
# 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
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
TasksMax=infinity
TimeoutStartSec=0
# 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
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target

Update docker;

apt-get update && apt-get install docker-ce
Hit:2 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:1 http://lon1.mirrors.digitalocean.com/ubuntu xenial InRelease                              
Hit:3 http://lon1.mirrors.digitalocean.com/ubuntu xenial-updates InRelease                      
Hit:4 https://repos.sonar.digitalocean.com/apt main InRelease
Hit:5 https://download.docker.com/linux/ubuntu xenial InRelease
Hit:6 http://lon1.mirrors.digitalocean.com/ubuntu xenial-backports InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-134 linux-headers-4.4.0-134-generic linux-image-4.4.0-134-generic
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  containerd.io docker-ce-cli
The following NEW packages will be installed:
  containerd.io docker-ce-cli
The following packages will be upgraded:
  docker-ce
1 upgraded, 2 newly installed, 0 to remove and 26 not upgraded.
Need to get 50.2 MB of archives.
After this operation, 44.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://download.docker.com/linux/ubuntu xenial/stable amd64 containerd.io amd64 1.2.0-1 [19.9 MB]
Get:2 https://download.docker.com/linux/ubuntu xenial/stable amd64 docker-ce amd64 5:18.09.0~3-0~ubuntu-xenial [17.4 MB]
Get:3 https://download.docker.com/linux/ubuntu xenial/stable amd64 docker-ce-cli amd64 5:18.09.0~3-0~ubuntu-xenial [13.0 MB]
Fetched 50.2 MB in 1s (32.8 MB/s)   
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_CTYPE 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 containerd.io.
(Reading database ... 138271 files and directories currently installed.)
Preparing to unpack .../containerd.io_1.2.0-1_amd64.deb ...
Unpacking containerd.io (1.2.0-1) ...
Preparing to unpack .../docker-ce_5%3a18.09.0~3-0~ubuntu-xenial_amd64.deb ...
Unpacking docker-ce (5:18.09.0~3-0~ubuntu-xenial) over (18.06.1~ce~3-0~ubuntu) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../docker-ce-cli_5%3a18.09.0~3-0~ubuntu-xenial_amd64.deb ...
Unpacking docker-ce-cli (5:18.09.0~3-0~ubuntu-xenial) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up containerd.io (1.2.0-1) ...
Setting up docker-ce-cli (5:18.09.0~3-0~ubuntu-xenial) ...
Setting up docker-ce (5:18.09.0~3-0~ubuntu-xenial) ...
update-alternatives: using /usr/bin/dockerd-ce to provide /usr/bin/dockerd (dockerd) in auto mode

Verify that it's upgraded, and started;

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

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:16:44 2018
  OS/Arch:          linux/amd64
  Experimental:     false

does docker-compose change anything ?

@thaJeztah
Copy link
Member

can't create unix socket /var/run/docker.sock: is a directory

I suspect you've (at some point) had a container that bind-mounted the docker-socket. In case of a race condition (where the docker socket is not yet up, but the container is), that will result in docker creating a directory at that location if you're using the -v flag.

To prevent that from happening; use the --mount flag instead. That flag won't create the missing path, and will instead refuse to start the container;

So instead of

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

Use this;

--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock

@thaJeztah
Copy link
Member

does docker-compose change anything ?

no, it shouldn't. docker-compose is a whole separate package

@reloxx13
Copy link

reloxx13 commented Nov 9, 2018

@thaJeztah yep, portainer is using docker.sock, but it shows it uses bind and not volume

grafik

think due the failed startups and missing unix:// it just failed at some point. never had that directory msg before.

@thaJeztah
Copy link
Member

If you're specifying a host path, it's a bind-mount, not a volume. It's confusing, because at the time the -v/--volume flag was added, there were no managed volumes yet, so they were considered to be the same

@thaJeztah
Copy link
Member

But it also depends which part of the API is used for those settings (the "mount" or "volume" API) 😅

@martsbradley
Copy link

Downgrading as mentioned by @Val fixed the issue for me - thank you.

apt remove --purge containerd.io docker-ce docker-ce-cli
wget https://download.docker.com/linux/debian/dists/stretch/pool/stable/amd64/docker-ce_18.06.1~ce~3-0~debian_amd64.deb
dpkg -i docker-ce_18.06.1ce3-0~debian_amd64.deb

@mdzidic
Copy link

mdzidic commented Nov 19, 2018

Hello,

I'm using Docker version 18.09.0, build 4d60db4

My systemd unit file is same as https://raw.githubusercontent.com/docker/docker-ce/v18.09.0/components/packaging/systemd/docker.service

I can't start docker service (after upgrade from 18.06 version), but mine fails on containerd service dependency.

containerd.service - containerd container runtime
   Loaded: loaded (/usr/lib/systemd/system/containerd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2018-11-19 17:29:50 CET; 4s ago
     Docs: https://containerd.io
  Process: 1905 ExecStartPre=/sbin/modprobe overlay (code=exited, status=1/FAILURE)

Edit: And I've found same open issue #475

@geeandy
Copy link

geeandy commented Nov 19, 2018

Work is in progress to add back socket activation (see
docker/docker-ce-packaging#257), which will be either in an upcoming patch release, or in a package update.

Hi Sebastiaan, when will be the upcoming patch release or package update for 18.09.0 CE? Is it a monthly cadence?

@thaJeztah
Copy link
Member

Hi Sebastiaan, when will be the upcoming patch release or package update for 18.09.0 CE? Is it a monthly cadence?

I think the goal is to have a release early/mid december, but there are some issues still being looked into that are desirable for inclusion, so the "safe" answer is "when it's done".

There's a workaround for this issue though (see #476 (comment))

@rdxmb
Copy link

rdxmb commented Dec 5, 2018

1. the dockerd systemd unit has been modified by the user. If the unit file is modified, it won't be updated with the latest version that ships with the rpm/deb package (rpm/deb will detect it's modified and will leave it untouched); never modify the systemd unit file itself, but use a "drop-in" file (override file) to customise the unit file.

correct. Ubuntu 16.04:
Without an existing /etc/systemd/system/docker.service: Upgrading from 18.06.1-ce to 18.09.0
is no problem

Running systemctl edit --full docker.service and adding just a comment before the upgrade will break the upgrade-process. And here is the diff after the upgrade:

# diff /etc/systemd/system/docker.service /lib/systemd/system/docker.service 
After=network-online.target docker.socket firewalld.service   | BindsTo=containerd.service
                                                              > After=network-online.target firewalld.service
Requires=docker.socket                                        <
ExecStart=/usr/bin/dockerd -H fd://                           | ExecStart=/usr/bin/dockerd -H unix://
LimitNOFILE=1048576                                           | TimeoutSec=0
                                                              > RestartSec=2
                                                              > Restart=always
                                                              >
                                                              > # Note that StartLimit* options were moved from "Service" to 
                                                              > # Both the old, and new location are accepted by systemd 229 
                                                              > # to make them work for either version of systemd.
                                                              > StartLimitBurst=3
                                                              >
                                                              > # Note that StartLimitInterval was renamed to StartLimitInter
                                                              > # Both the old, and new name are accepted by systemd 230 and 
                                                              > # this option work for either version of systemd.
                                                              > StartLimitInterval=60s
                                                              >
                                                              > LimitNOFILE=infinity
# Uncomment TasksMax if your systemd version supports it.     |
# Only systemd 226 and above support this version.            | # Comment TasksMax if your systemd version does not supports 
                                                              > # Only systemd 226 and above support this option.
TimeoutStartSec=0                                             |
                                                              >
# restart the docker process if it exits prematurely          <
Restart=on-failure                                            <
StartLimitBurst=3                                             <
StartLimitInterval=60s                                        <
                                                              <
# just a comment to check the upgrade process                 <

//edit: Seems like using the override-mechanism using systemctl edit (without using --full) is the better way to do.

@rdxmb
Copy link

rdxmb commented Dec 5, 2018

//edit: Seems like using the override-mechanism using systemctl edit (without using --full) is the better way to do.

This is in fact another workaround, which will help to successfully upgrade to 18.09.

systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/docker.service.d
└─override.conf

Active: active (running) since Wed 2018-12-05 15:32:16 CET; 39s ago
Docs: https://docs.docker.com
Main PID: 58181 (dockerd)
Tasks: 13
Memory: 40.0M
CPU: 456ms
CGroup: /system.slice/docker.service
└─58181 /usr/bin/dockerd -H unix://

Dec 05 15:32:15 docker-single-host systemd[1]: Starting Docker Application Container Engine...
Dec 05 15:32:16 docker-single-host systemd[1]: Started Docker Application Container Engine.

@thaJeztah
Copy link
Member

18.09.1 was released yesterday, so it should be there

@bigfishinnet
Copy link

Getting similar errors starting the service. That is not to say I am not being stupid though.

@seemethere
Copy link

Seems to work fine for me once I enable/start the socket
~/notes eli@derry
❯ systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: https://docs.docker.com

Jan 10 22:19:15 derry dockerd[18322]: time="2019-01-10T22:19:15.411085015Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420bfa8e0, TRANSIENT_FAILURE" module=grpc
Jan 10 22:19:15 derry dockerd[18322]: time="2019-01-10T22:19:15.411114902Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420bfa8e0, CONNECTING" module=grpc
Jan 10 22:19:15 derry dockerd[18322]: time="2019-01-10T22:19:15.411137709Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420bfa8e0, TRANSIENT_FAILURE" module=grpc
Jan 10 22:19:16 derry dockerd[18322]: time="2019-01-10T22:19:16.158060345Z" level=warning msg="grpc: addrConn.transportMonitor exits due to: context canceled" module=grpc
Jan 10 22:19:23 derry dockerd[18322]: time="2019-01-10T22:19:23.885790737Z" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.Ta>
Jan 10 22:19:28 derry dockerd[18322]: time="2019-01-10T22:19:28.074556524Z" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.Ta>
Jan 10 22:28:19 derry systemd[1]: Stopping Docker Application Container Engine...
Jan 10 22:28:19 derry dockerd[18322]: time="2019-01-10T22:28:19.770089595Z" level=info msg="Processing signal 'terminated'"
Jan 10 22:28:19 derry dockerd[18322]: time="2019-01-10T22:28:19.772797456Z" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd na>
Jan 10 22:28:19 derry systemd[1]: Stopped Docker Application Container Engine.

~/notes eli@derry
❯ sudo systemctl enable docker.socket
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /usr/lib/systemd/system/docker.socket.

~/notes eli@derry
❯ sudo systemctl start docker.socket

~/notes eli@derry
❯ systemctl status docker.socket
● docker.socket - Docker Socket for the API
   Loaded: loaded (/usr/lib/systemd/system/docker.socket; enabled; vendor preset: disabled)
   Active: active (listening) since Thu 2019-01-10 22:28:59 UTC; 5s ago
   Listen: /var/run/docker.sock (Stream)
    Tasks: 0 (limit: 4915)
   Memory: 0B
   CGroup: /system.slice/docker.socket

Jan 10 22:28:59 derry systemd[1]: Starting Docker Socket for the API.
Jan 10 22:28:59 derry systemd[1]: Listening on Docker Socket for the API.

~/notes eli@derry
❯ systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: https://docs.docker.com

Jan 10 22:19:15 derry dockerd[18322]: time="2019-01-10T22:19:15.411085015Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420bfa8e0, TRANSIENT_FAILURE" module=grpc
Jan 10 22:19:15 derry dockerd[18322]: time="2019-01-10T22:19:15.411114902Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420bfa8e0, CONNECTING" module=grpc
Jan 10 22:19:15 derry dockerd[18322]: time="2019-01-10T22:19:15.411137709Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420bfa8e0, TRANSIENT_FAILURE" module=grpc
Jan 10 22:19:16 derry dockerd[18322]: time="2019-01-10T22:19:16.158060345Z" level=warning msg="grpc: addrConn.transportMonitor exits due to: context canceled" module=grpc
Jan 10 22:19:23 derry dockerd[18322]: time="2019-01-10T22:19:23.885790737Z" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.Ta>
Jan 10 22:19:28 derry dockerd[18322]: time="2019-01-10T22:19:28.074556524Z" level=info msg="ignoring event" module=libcontainerd namespace=moby topic=/tasks/delete type="*events.Ta>
Jan 10 22:28:19 derry systemd[1]: Stopping Docker Application Container Engine...
Jan 10 22:28:19 derry dockerd[18322]: time="2019-01-10T22:28:19.770089595Z" level=info msg="Processing signal 'terminated'"
Jan 10 22:28:19 derry dockerd[18322]: time="2019-01-10T22:28:19.772797456Z" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd na>
Jan 10 22:28:19 derry systemd[1]: Stopped Docker Application Container Engine.

~/notes eli@derry
❯ docker version
Client:
 Version:           18.09.1
 API version:       1.39
 Go version:        go1.10.6
 Git commit:        4c52b90
 Built:             Wed Jan  9 19:35:43 2019
 OS/Arch:           linux/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          18.09.1
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       4c52b90
  Built:            Wed Jan  9 19:06:30 2019
  OS/Arch:          linux/amd64
  Experimental:     true

@KyleSanderson
Copy link

Can anyone confirm that CentOS stable works now from performing a simple yum update? There's a reason we tried to trust the RHEL side of the ecosystem...

@reloxx13
Copy link

reloxx13 commented Jan 13, 2019

did not receive on rasbian till now :S

docker-ce ist schon die neueste Version (5:18.09.0~3-0~raspbian-stretch).
(already newest version)

cat /etc/apt/sources.list.d/docker.list
deb [arch=armhf] https://download.docker.com/linux/raspbian stretch edge

@reloxx13
Copy link

reloxx13 commented Feb 27, 2019

after 4 months, still not possible to install and run docker on a fresh rasbian without a workaround.

if needed i can grant ssh access to the devs.

docker-socket was still missing
sudo curl https://raw.githubusercontent.com/docker/docker-ce-packaging/master/systemd/docker.socket -o /lib/systemd/system/docker.socket

pi@Pi0W-01:~ $ curl -sSL https://get.docker.com | sh
# Executing docker install script, commit: 40b1b76
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sudo -E sh -c curl -fsSL "https://download.docker.com/linux/raspbian/gpg" | apt-key add -qq - >/dev/null
Warning: apt-key output should not be parsed (stdout is not a terminal)
+ sudo -E sh -c echo "deb [arch=armhf] https://download.docker.com/linux/raspbian stretch edge" > /etc/apt/sources.list.d/docker.list
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null
If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:

  sudo usermod -aG docker pi

Remember that you will have to log out and back in for this to take effect!

WARNING: Adding a user to the "docker" group will grant the ability to run
         containers which can be used to obtain root privileges on the
         docker host.
         Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
         for more information.

** DOCKER ENGINE - ENTERPRISE **

If you’re ready for production workloads, Docker Engine - Enterprise also includes:

  * SLA-backed technical support
  * Extended lifecycle maintenance policy for patches and hotfixes
  * Access to certified ecosystem content

** Learn more at https://dockr.ly/engine2 **

ACTIVATE your own engine to Docker Engine - Enterprise using:

  sudo docker engine activate

pi@Pi0W-01:~ $ sudo usermod -aG docker pi

pi@Pi0W-01:~ $ sudo docker run -d -p 5555:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /home/pi/Docker/Portainer/data:/data --name=Portainer --restart=unless-stopped portainer/portainer
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
pi@Pi0W-01:~ $ docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.


@BurkovBA
Copy link

BurkovBA commented Mar 2, 2019

On Debian 9:

$ sudo aptitude install docker-ce
[sudo] password for burkov: 
The following partially installed packages will be configured:
  docker-ce 
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
Setting up docker-ce (5:18.09.3~3-0~debian-stretch) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/bin/dockerd-ce because link group dockerd is broken
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 Sat 2019-03-02 10:15:54 CET; 12ms ago
     Docs: https://docs.docker.com
  Process: 31971 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 31971 (code=exited, status=1/FAILURE)
      CPU: 170ms

Mar 02 10:15:54 debian-2gb-nbg1-1 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Mar 02 10:15:54 debian-2gb-nbg1-1 systemd[1]: Failed to start Docker Application Container Engine.
Mar 02 10:15:54 debian-2gb-nbg1-1 systemd[1]: docker.service: Unit entered failed state.
Mar 02 10:15:54 debian-2gb-nbg1-1 systemd[1]: docker.service: Failed with result 'exit-code'.
dpkg: error processing package docker-ce (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)
Setting up docker-ce (5:18.09.3~3-0~debian-stretch) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/bin/dockerd-ce because link group dockerd is broken
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 Sat 2019-03-02 10:15:57 CET; 15ms ago
     Docs: https://docs.docker.com
  Process: 32081 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 32081 (code=exited, status=1/FAILURE)
      CPU: 119ms

Mar 02 10:15:57 debian-2gb-nbg1-1 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Mar 02 10:15:57 debian-2gb-nbg1-1 systemd[1]: Failed to start Docker Application Container Engine.
Mar 02 10:15:57 debian-2gb-nbg1-1 systemd[1]: docker.service: Unit entered failed state.
Mar 02 10:15:57 debian-2gb-nbg1-1 systemd[1]: docker.service: Failed with result 'exit-code'.
dpkg: error processing package docker-ce (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 docker-ce

@thaJeztah
Copy link
Member

Can you check the logs for docker.service and containerd.service? Unfortunately the output of systemd is usually not showing the actual error (other than: it failed to start)

@BurkovBA
Copy link

BurkovBA commented Mar 2, 2019

@thaJeztah I looked into /var/log/error.log and found out that bridge kernel module failed to install as here: #598

Rebooting the machine solved the issue.

Thanks for answering on Saturday!)

@wildan-m
Copy link

I have same issue, here is my solution based on @audioscavenger comment:

sudo systemctl edit docker.service

add:

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H unix:// -H tcp://127.0.0.1:2375
This will automatically create a file /etc/systemd/system/docker.service.d/override.conf

then reload and restart docker:

sudo systemctl daemon-reload
sudo systemctl restart docker.service

moby/moby#33931 (comment)

@thaJeztah
Copy link
Member

@wildanmuhlis2 what version of docker do you have installed? no more changes should be needed in current versions (unless you want to customise where the API is listening on)

@wildan-m
Copy link

@thaJeztah
Docker Version:

Client:
 Version:           18.09.6
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        481bc77
 Built:             Sat May  4 02:35:57 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.6
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.8
  Git commit:       481bc77
  Built:            Sat May  4 01:59:36 2019
  OS/Arch:          linux/amd64
  Experimental:     false

Ubuntu Version:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04 LTS
Release:        18.04
Codename:       bionic

@Bondalive
Copy link

Hello

Getting the below errors
Can someone help me out?
1)ERORR-1
root@bond:# service docker start
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
2)ERORR-2
root@bond:
# systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
root@bond:~# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: e
Drop-In: /etc/systemd/system/docker.service.d
└─override.conf
Active: failed (Result: exit-code) since Sun 2019-12-22 05:58:49 IST; 1s ago
Docs: https://docs.docker.com
Process: 13564 ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2375 -H unix:
Main PID: 13564 (code=exited, status=1/FAILURE)

Dec 22 05:58:49 bond systemd[1]: docker.service: Service hold-off time over
Dec 22 05:58:49 bond systemd[1]: docker.service: Scheduled restart job, res
Dec 22 05:58:49 bond systemd[1]: Stopped Docker Application Container Engin
Dec 22 05:58:49 bond systemd[1]: docker.service: Start request repeated too
Dec 22 05:58:49 bond systemd[1]: docker.service: Failed with result 'exit-c
Dec 22 05:58:49 bond systemd[1]: Failed to start Docker Application Contain
lines 1-15/15 (END)

@xll1452
Copy link

xll1452 commented Feb 27, 2020

docker version:
Client:
Version: 18.09.9
API version: 1.39
Go version: go1.11.13
Git commit: 039a7df9ba
Built: Wed Sep 4 16:51:21 2019
OS/Arch: linux/amd64
Experimental: false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? @thaJeztah

@thaJeztah
Copy link
Member

@xll1452 that error in itself doesn't tell much;

  • check if the user you're running that command as has permissions to use to the /var/run/docker.sock socket (does it work if you use sudo?)
  • is the daemon actually running? (check systemctl status docker.service)
  • if the daemon was not running, but fails to start, check the daemon logs to see if there's a reason why ( sudo journalctl -xu docker.service)

@ptrcnull
Copy link

ptrcnull commented Jul 9, 2020

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

@thaJeztah
Copy link
Member

are you running the install manually, or also automated, similar to the linked issue?

@ptrcnull
Copy link

ptrcnull commented Jul 9, 2020

I was trying to install Docker during a Packer build, which executes scripts via SSH, so I'd say it was also automated.

@thaJeztah
Copy link
Member

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
Copy link

superdit commented Jul 11, 2020

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.123-0ubuntu-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.123-0ubuntu-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
Copy link

cgd1 commented Sep 3, 2020

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
Copy link

ptrcnull commented Sep 4, 2020

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

@rubemfsv
Copy link

rubemfsv commented Oct 8, 2020

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
Copy link

cgd1 commented Oct 11, 2020

@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 !! 🥇

@cgd1
Copy link

cgd1 commented Oct 11, 2020

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

still experiencing issue

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

No branches or pull requests