Failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd

Hi,

new to docker here, noticed that docker crashed but can’t restart it ?

Debian 9
ii docker-ce 5:18.09.0~3-0~debian-stretch
ii docker-ce-cli 5:18.09.0~3-0~debian-stretch

systemctl restart docker

Job for docker.service failed because the control process exited with error code.
See “systemctl status docker.service” and “journalctl -xe” for details.

journalctl -xe

– Unit docker.service has finished shutting down.
Nov 10 13:20:58 edgar systemd[1]: Starting Docker Application Container Engine…
– Subject: Unit docker.service has begun start-up
– Defined-By: systemd
– Support:

– Unit docker.service has begun starting up.
Nov 10 13:20:58 edgar dockerd[14611]: Failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd
Nov 10 13:20:58 edgar systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Nov 10 13:20:58 edgar systemd[1]: Failed to start Docker Application Container Engine.
– Subject: Unit docker.service has failed
– Defined-By: systemd
– Support:

– Unit docker.service has failed.

– The result is failed.
Nov 10 13:20:58 edgar systemd[1]: docker.service: Unit entered failed state.
Nov 10 13:20:58 edgar systemd[1]: docker.service: Failed with result ‘exit-code’.
Nov 10 13:21:00 edgar systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Nov 10 13:21:00 edgar systemd[1]: Stopped Docker Application Container Engine.
– Subject: Unit docker.service has finished shutting down
– Defined-By: systemd
– Support:

– Unit docker.service has finished shutting down.
Nov 10 13:21:00 edgar systemd[1]: Starting Docker Application Container Engine…
– Subject: Unit docker.service has begun start-up
– Defined-By: systemd
– Support:

– Unit docker.service has begun starting up.
Nov 10 13:21:00 edgar dockerd[14640]: Failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd
Nov 10 13:21:00 edgar systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Nov 10 13:21:00 edgar systemd[1]: Failed to start Docker Application Container Engine.
– Subject: Unit docker.service has failed
– Defined-By: systemd
– Support:

– Unit docker.service has failed.

– The result is failed.
Nov 10 13:21:00 edgar systemd[1]: docker.service: Unit entered failed state.
Nov 10 13:21:00 edgar systemd[1]: docker.service: Failed with result ‘exit-code’.
Nov 10 13:21:02 edgar systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Nov 10 13:21:02 edgar systemd[1]: Stopped Docker Application Container Engine.
– Subject: Unit docker.service has finished shutting down
– Defined-By: systemd
– Support:

– Unit docker.service has finished shutting down.
Nov 10 13:21:02 edgar systemd[1]: docker.service: Start request repeated too quickly.
Nov 10 13:21:02 edgar systemd[1]: Failed to start Docker Application Container Engine.
– Subject: Unit docker.service has failed
– Defined-By: systemd
– Support:

– Unit docker.service has failed.

– The result is failed.
Nov 10 13:21:02 edgar systemd[1]: docker.service: Unit entered failed state.
Nov 10 13:21:02 edgar systemd[1]: docker.service: Failed with result ‘exit-code’.

->Can’t even locate where is the error ?

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
└─DeviceMapper.conf
Active: failed (Result: exit-code) since Sat 2018-11-10 13:21:02 CET; 1min 57s ago
Docs: https://docs.docker.com
Process: 14640 ExecStart=/usr/bin/dockerd --storage-driver=devicemapper -H fd:// (code=exited, status=1/FAILURE)
Main PID: 14640 (code=exited, status=1/FAILURE)
CPU: 81ms

Nov 10 13:21:00 edgar systemd[1]: docker.service: Unit entered failed state.
Nov 10 13:21:00 edgar systemd[1]: docker.service: Failed with result ‘exit-code’.
Nov 10 13:21:02 edgar systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Nov 10 13:21:02 edgar systemd[1]: Stopped Docker Application Container Engine.
Nov 10 13:21:02 edgar systemd[1]: docker.service: Start request repeated too quickly.
Nov 10 13:21:02 edgar systemd[1]: Failed to start Docker Application Container Engine.
Nov 10 13:21:02 edgar systemd[1]: docker.service: Unit entered failed state.
Nov 10 13:21:02 edgar systemd[1]: docker.service: Failed with result ‘exit-code’.

I just installed Collabora Online to integrate with Nextcloud and all was fine, then now suddenly nothing works, nothing was changed in config, can’t find what is not correct ?

How to make docker start again ?

PS : followed this to deploy : https://www.linuxbabe.com/cloud-storage/integrate-collabora-online-server-nextcloud-ubuntu-16-04

Thanks in advance for any help.

Hi iniOr,

I had the same issue under Ubuntu 18.04.

My problem was caused by the fact that I had in the past overrode the value of ExecStart of the docker service. I had copied the original ExecStart including -H fd:// which after recent update stopped working. I’ve noticed that the orignal docker.service file now contains -H unix:// instead. I can see in the data You’ve sent that Your service is using -H fd:// as well.

So the solution that worked for me was to edit the docker’s systemd unit file and change the ExecStart:
sudo systemctl edit docker.service

The value that I had to override was ExecStart and I had to change fd:// to unix://:
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H unix://

Best Regards,
saulg

5 Likes

Last reply helped me on one installation. Same steps on a seccond installation failed again complainging about unsupported devicemapper driver.

Thanks for your helpfull reply Saulg, I followed your instructions and now my Docker is now working again.

For the record after restarting Docker, I got this issue in Collabora and Nextcloud :

Now everything is fixed, thanks for your help :slight_smile:

Hey saulg,

Solution worked for me as well after recently updating my docker-ce version on an Ubuntu Server 18.04.1 VM. Thanks for taking the time to post the reply to ini0r. That would have taken me days to figure out.

Thanks so much for the reply, this also helps me fix the issue on Cent OS.

You saved me!!! Thanks!

Though the issue is old, I’ve just discovered a new possible reason for it.

Ubuntu Xenial host came with 4.4 kernel, the root FS was BTRFS.

Trying to start the service produced little to no error messages bar the one the topic was started from. I had to manually run dockerd to see more of the error message, across which was reference to overlay2 support on BTRFS (or absence of it with current kernel version, that is).

Installing linux-generic-hwe-16.04 (kernel 4.15) and rebooting the host resolved the issue.

thanks to saulg for the fix

I was installing on ubuntu focal using the commandline directions.

got the install error:

Setting up docker-ce (5:20.10.7~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 2021-07-11 02:33:35 PDT; 6ms ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
    Process: 493396 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 493396 (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)

After running (and stopping) the command:

sudo /usr/bin/dockerd -H unix:// --containerd=/run/containerd/containerd.sock

I was able to repeat the install without problem. (side note: my vpn also messed with the install until I turned it off)

The process list after install and running hello-world shows:

/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

I just ran into this (Debian 10) and believe it is due to invoke-rc.d behaviour.

At the end of /var/lib/dpkg/info/docker-ce.postinst is a call to:

invoke-rc.d docker start || exit 1

This script checks multi-user.target, if this is inactive, appending job-mode=ignore-dependencies, from the script:

# avoid deadlocks during bootup and shutdown from units/hooks
# which call "invoke-rc.d service reload" and similar, since
# the synchronous wait plus systemd's normal behaviour of
# transactionally processing all dependencies first easily
# causes dependency loops
if ! systemctl --quiet is-active multi-user.target; then
	sctl_args="--job-mode=ignore-dependencies"
fi

Man systemctl states:
If "ignore-dependencies" is specified, then all unit dependencies are ignored for this new job and the operation is executed immediately. If passed, no required units of the unit passed will be pulled in, and no ordering dependencies will be honored. This is mostly a debugging and rescue tool for the administrator and should not be used by applications.

The key part being "If passed, no required units of the unit passed will be pulled in, and no ordering dependencies will be honored."

…suggesting docker.service is started independently of docker.socket (which is what I observed; docker.service was started first)

The fix was to wait for multi-user.target to become active before installing docker.

An alternative would be to update the packaging of the docker-ce deb use to use deb-systemd-invoke in the package (via dh_systemd_helper) and thus use pure systemd, I can’t see that script using ignore-dependencies.