Search code examples
dockerubuntuhaskell-snap-framework

Docker fails with "failed to start containerd: timeout waiting for containerd to start"


I have docker installed on Ubuntu 18.04.2 with snap.

When I try to start docker it fails with the following error log.

2020-07-16T23:49:14Z docker.dockerd[932]: failed to start containerd: timeout waiting for containerd to start
2020-07-16T23:49:14Z systemd[1]: snap.docker.dockerd.service: Main process exited, code=exited, status=1/FAILURE
2020-07-16T23:49:14Z systemd[1]: snap.docker.dockerd.service: Failed with result 'exit-code'.
2020-07-16T23:49:14Z systemd[1]: snap.docker.dockerd.service: Service hold-off time over, scheduling restart.
2020-07-16T23:49:14Z systemd[1]: snap.docker.dockerd.service: Scheduled restart job, restart counter is at 68.
2020-07-16T23:49:14Z systemd[1]: Stopped Service for snap application docker.dockerd.
2020-07-16T23:49:14Z systemd[1]: Started Service for snap application docker.dockerd.

It goes over and over into a restart loop. What should I do to get docker working again?


Solution

  • In this case, docker was waiting for containerd to start. The containerd pid is located at

    /var/snap/docker/471/run/docker/containerd/containerd.pid. 
    

    This pid didn't exist. But the file was not deleted when the server was unceremoniously shutdown. Deleting this file allows the containerd process to start again, and problem is solved. I believe similar problems exist out there where docker.pid file also points to a non-existent pid.