Docker daemon won't start anymore

Hi,
recently I did an apt update on my ubuntu server which in the end seemingly corrupted my docker setup so that I can not start it anymore.
Maybe somebody could help before I give up and install my ubuntu server from scratch?

My current status:

sudo 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
             └─00-move-library.conf
     Active: failed (Result: exit-code) since Mon 2023-09-18 17:20:59 CEST; 56s ago
TriggeredBy: × docker.socket
    Process: 1601 ExecStart=/usr/bin/dockerd -g /mnt/ssd/docker -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 1601 (code=exited, status=1/FAILURE)
        CPU: 87ms

Sep 18 17:20:59 bolt systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Sep 18 17:20:59 bolt systemd[1]: Stopped Docker Application Container Engine.
Sep 18 17:20:59 bolt systemd[1]: docker.service: Start request repeated too quickly.
Sep 18 17:20:59 bolt systemd[1]: docker.service: Failed with result 'exit-code'.
Sep 18 17:20:59 bolt systemd[1]: Failed to start Docker Application Container Engine.


sudo systemctl start docker
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.


journalctl -xeu docker.service
░░
░░ The unit docker.service has entered the 'failed' state with result 'exit-code'.
Sep 18 17:23:08 bolt systemd[1]: Failed to start Docker Application Container Engine.
░░ Subject: A start job for unit docker.service has failed
░░ Defined-By: systemd
░░
░░ A start job for unit docker.service has finished with a failure.
░░
░░ The job identifier is 2652 and the job result is failed.
Sep 18 17:23:10 bolt systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░
░░ Automatic restarting of the unit docker.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Sep 18 17:23:10 bolt systemd[1]: Stopped Docker Application Container Engine.
░░ Subject: A stop job for unit docker.service has finished
░░ Defined-By: systemd
░░
░░ A stop job for unit docker.service has finished.
░░
░░ The job identifier is 2800 and the job result is done.
Sep 18 17:23:10 bolt systemd[1]: docker.service: Start request repeated too quickly.
Sep 18 17:23:10 bolt systemd[1]: docker.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░
░░ The unit docker.service has entered the 'failed' state with result 'exit-code'.
Sep 18 17:23:10 bolt systemd[1]: Failed to start 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 2800 and the job result is failed.

I have already tried to reinstall docker from scratch but it did not help.

You could enable debug mode in the daemon to get more information:: https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file

But it seems you are using an old option to set the docker data root. You should replace “-g” with “--data-root” as it can be found in the documentation:

      --data-root string                      Root directory of persistent Docker state (default "/var/lib/docker")

Are you sure it was ran ap update which would update only the apt cache?

trying…
Sorry I meant, I did an apt update && apt upgrade.

Well, if I’m right about the parameter, next time don’t forget to use apt-mark hold to hold docker-ce so apt upgrade will not upgrade Docker unless you manually upgrade it.

apt-mark hold docker-ce docker-ce-cli docker-ce-rootless-extras

I updated

/etc/systemd/system/docker.service.d/00-move-library.conf

[Service]
ExecStart=/usr/bin/dockerd --data-root /mnt/ssd/docker -H fd:// --containerd=/run/containerd/containerd.sock
# EOF

also I updated /lib/systemd/system/docker.service
with the --data-root setting

Now I get this error:

systemctl daemon-reload
systemctl start docker
Failed to start docker.service: Unit docker.service has a bad unit file setting.
See system logs and 'systemctl status docker.service' for details.
systemctl status docker.service
Warning: The unit file, source configuration file or drop-ins of docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.
× docker.service - Docker Application Container Engine
     Loaded: bad-setting (Reason: Unit docker.service has a bad unit file setting.)
    Drop-In: /etc/systemd/system/docker.service.d
             └─00-move-library.conf
     Active: failed (Result: exit-code) since Mon 2023-09-18 19:38:28 CEST; 7min ago
TriggeredBy: × docker.socket
       Docs: https://docs.docker.com
   Main PID: 1958 (code=exited, status=1/FAILURE)
        CPU: 134ms

Sep 18 19:38:28 bolt systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Sep 18 19:38:28 bolt systemd[1]: Stopped Docker Application Container Engine.
Sep 18 19:38:28 bolt systemd[1]: docker.service: Start request repeated too quickly.
Sep 18 19:38:28 bolt systemd[1]: docker.service: Failed with result 'exit-code'.
Sep 18 19:38:28 bolt systemd[1]: Failed to start Docker Application Container Engine.
Sep 18 19:38:29 bolt systemd[1]: docker.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.
Sep 18 19:41:00 bolt systemd[1]: docker.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.
Sep 18 19:44:06 bolt systemd[1]: docker.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.

That won’t be enough.

Try this:

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --data-root /mnt/ssd/docker -H fd:// --containerd=/run/containerd/containerd.sock

The first ExecStart is required so only the next ExecStart will be applied.

its working!

mv /etc/systemd/system/docker.service.d/00-move-library.conf /etc/systemd/system/docker.service.d/00-move-library.conf.bak
systemctl daemon-reload
systemctl start docker
1 Like

thank you very much for your help!!!

Great! That also helped me! Thanks a lot!