Cannot start docker.service on systemctl

I installed docker engine on ubuntu 20.04 and got the following error when trying to start docker in systemctl

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

When i check systemctl status docker.service:

 Γ— docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sun 2024-10-13 06:41:31 +07; 12s ago
TriggeredBy: Γ— docker.socket
       Docs: https://docs.docker.com
    Process: 10079 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 10079 (code=exited, status=1/FAILURE)
        CPU: 455ms
Thg 10 13 06:41:31 aml-s9xx-box systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Thg 10 13 06:41:31 aml-s9xx-box systemd[1]: docker.service: Start request repeated too quickly.
Thg 10 13 06:41:31 aml-s9xx-box systemd[1]: docker.service: Failed with result 'exit-code'.
Thg 10 13 06:41:31 aml-s9xx-box systemd[1]: Failed to start docker.service - Docker Application Container Engine.

When i check journalctl -xeu docker.service:

Thg 10 13 06:40:18 aml-s9xx-box systemd[1]: Starting docker.service - Docker Application Container Engine...
Thg 10 13 06:40:18 aml-s9xx-box dockerd[9658]: time="2024-10-13T06:40:18.596446190+07:00" level=info msg="Starting up"
Thg 10 13 06:40:18 aml-s9xx-box dockerd[9658]: time="2024-10-13T06:40:18.600896007+07:00" level=info msg="detected 127.0.0.53 nameserver, assuming systemd-resolved, so>
Thg 10 13 06:40:19 aml-s9xx-box dockerd[9658]: time="2024-10-13T06:40:19.727893152+07:00" level=info msg="Loading containers: start."
Thg 10 13 06:40:19 aml-s9xx-box dockerd[9658]: time="2024-10-13T06:40:19.804260600+07:00" level=info msg="unable to detect if iptables supports xlock: 'iptables --wait>
Thg 10 13 06:40:20 aml-s9xx-box dockerd[9658]: time="2024-10-13T06:40:20.092485297+07:00" level=info msg="stopping event stream following graceful shutdown" error="<ni>
Thg 10 13 06:40:20 aml-s9xx-box dockerd[9658]: failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to register ">
Thg 10 13 06:40:20 aml-s9xx-box dockerd[9658]:  (exit status 4)
Thg 10 13 06:40:20 aml-s9xx-box systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Thg 10 13 06:40:20 aml-s9xx-box systemd[1]: docker.service: Failed with result 'exit-code'.
Thg 10 13 06:40:20 aml-s9xx-box systemd[1]: Failed to start docker.service - Docker Application Container Engine.
Thg 10 13 06:40:22 aml-s9xx-box systemd[1]: docker.service: Scheduled restart job, restart counter is at 1.

I try to remove --purge docker installation, and reinstall, but same error still here.
so how to fix it ?
(sorry if I translated wrong)

Try journalctl with the --no-pager flag, otherwise it will cut the and of the lines out from the output and we don’t see the exact error message.

Please, also show the output of the following commands

docker info
docker version
dpkg -l | grep docker

And the last question, where and how did you install Ubuntu 20.04? Is it ona local machine or in the cloud? Is it WSL on Windows or a physical Linux machine?

Also, please share a link to the guide you followed to install Docker.

And last:


Please, format your posts according to the following guide: How to format your forum posts
In short: please, use </> button to share codes, terminal outputs, error messages or anything that can contain special characters which would be interpreted by the MarkDown filter. Use the preview feature to make sure your text is formatted as you would expect it and check your post after you have sent it so you can still fix it.

Example code block:

```
echo "I am a code."
echo "An athletic one, and I wanna run."
```

This time I edited your question to add code blocks.

1 Like

Thanks for replying
So 1 month later I updated to ubuntu rolling (oracular) by armbian for my mini s905x server for ad blocking and using honeygain in docker for my home network
and it still gets the old error
But this time it’s different

Here is my new systemctl status docker.service:

Γ— docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Mon 2024-12-09 11:54:29 +07; 11min ago
 Invocation: 1b608f4f55114f4f81f838ffe9759db6
TriggeredBy: Γ— docker.socket
       Docs: https://docs.docker.com
    Process: 2232 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=2)
   Main PID: 2232 (code=exited, status=2)

Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]: go.opencensus.io/stats/view.init.0.gowrap1()
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]:         /root/build-deb/engine/vendor/go.opencensus.io/stats/view/worker.go:34 +0x28 fp=0x40000787d0 sp=0x40000787b0 pc=>
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]: runtime.goexit({})
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]:         /usr/local/go/src/runtime/asm_arm64.s:1222 +0x4 fp=0x40000787d0 sp=0x40000787d0 pc=0xaaaac277f854
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]: created by go.opencensus.io/stats/view.init.0 in goroutine 1
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]:         /root/build-deb/engine/vendor/go.opencensus.io/stats/view/worker.go:34 +0x98
Thg 12 09 11:54:29 aml-s9xx-box systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Thg 12 09 11:54:29 aml-s9xx-box systemd[1]: docker.service: Start request repeated too quickly.
Thg 12 09 11:54:29 aml-s9xx-box systemd[1]: docker.service: Failed with result 'exit-code'.
Thg 12 09 11:54:29 aml-s9xx-box systemd[1]: Failed to start docker.service - Docker Application Container Engine.

Here is my new journalctl -xeu docker.service:

β–‘β–‘ Subject: Automatic restarting of a unit has been scheduled
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: http://www.ubuntu.com/support
β–‘β–‘
β–‘β–‘ Automatic restarting of the unit docker.service has been scheduled, as the result for
β–‘β–‘ the configured Restart= setting for the unit.
Thg 12 09 11:54:29 aml-s9xx-box systemd[1]: docker.service: Start request repeated too quickly.
Thg 12 09 11:54:29 aml-s9xx-box systemd[1]: docker.service: Failed with result 'exit-code'.
β–‘β–‘ Subject: Unit failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: http://www.ubuntu.com/support
β–‘β–‘
β–‘β–‘ The unit docker.service has entered the 'failed' state with result 'exit-code'.
Thg 12 09 11:54:29 aml-s9xx-box systemd[1]: Failed to start docker.service - Docker Application Container Engine.
β–‘β–‘ Subject: A start job for unit docker.service has failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: http://www.ubuntu.com/support
β–‘β–‘
β–‘β–‘ A start job for unit docker.service has finished with a failure.
β–‘β–‘
β–‘β–‘ The job identifier is 755 and the job result is failed.
 ESCOD
β–‘β–‘
β–‘β–‘ A start job for unit docker.service has finished with a failure.
β–‘β–‘
β–‘β–‘ The job identifier is 653 and the job result is failed.
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]:         /usr/local/go/src/runtime/asm_arm64.s:1222 +0x4 fp=0x400007bfd0 sp=0x400007bfd0 pc=0xaaaac277f854
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]: created by runtime.gcBgMarkStartWorkers in goroutine 1
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]:         /usr/local/go/src/runtime/mgc.go:1234 +0x28
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]: goroutine 5 gp=0x40002736c0 m=nil [select]:
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]: runtime.gopark(0x4000078768?, 0x3?, 0x0?, 0xe0?, 0x4000078762?)
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]:         /usr/local/go/src/runtime/proc.go:402 +0xc8 fp=0x4000078610 sp=0x40000785f0 pc=0xaaaac2745958
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]: runtime.selectgo(0x4000078768, 0x400007875c, 0x40001bfc00?, 0x0, 0x0?, 0x1)
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]:         /usr/local/go/src/runtime/select.go:327 +0x614 fp=0x4000078720 sp=0x4000078610 pc=0xaaaac2758f24
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]: go.opencensus.io/stats/view.(*worker).start(0x40001bfc00)
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]:         /root/build-deb/engine/vendor/go.opencensus.io/stats/view/worker.go:292 +0x88 fp=0x40000787b0 sp=0x4000078720 pc>
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]: go.opencensus.io/stats/view.init.0.gowrap1()
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]:         /root/build-deb/engine/vendor/go.opencensus.io/stats/view/worker.go:34 +0x28 fp=0x40000787d0 sp=0x40000787b0 pc=>
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]: runtime.goexit({})
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]:         /usr/local/go/src/runtime/asm_arm64.s:1222 +0x4 fp=0x40000787d0 sp=0x40000787d0 pc=0xaaaac277f854
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]: created by go.opencensus.io/stats/view.init.0 in goroutine 1
Thg 12 09 11:54:27 aml-s9xx-box dockerd[2232]:         /root/build-deb/engine/vendor/go.opencensus.io/stats/view/worker.go:34 +0x98
Thg 12 09 11:54:29 aml-s9xx-box systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.

Here is the docker info:

Client: Docker Engine - Community
 Version:    27.3.1
 Context:    default
 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

docker version:

Client: Docker Engine - Community
 Version:           27.3.1
 API version:       1.47
 Go version:        go1.22.7
 Git commit:        ce12230
 Built:             Fri Sep 20 11:41:19 2024
 OS/Arch:           linux/arm64
 Context:           default
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

dpkg -l | grep docker:

ii  docker-ce                                  5:27.3.1-1~ubuntu.24.10~oracular      arm64        Docker: the open-source application container engine
ii  docker-ce-cli                              5:27.3.1-1~ubuntu.24.10~oracular      arm64        Docker CLI: the open-source application container engine

(sorry if I translated wrong)
(Maybe the text formatting will be wrong because there is no preview in the reply, so please ignore it)
Thanks!

Armbian is not Ubuntu, some releases may be based on it.

I don’t think there is official support for Armbian, so you would rather need to ask on their forums.