简体   繁体   English

Docker 失败并显示“无法启动 containerd:等待 containerd 启动超时”

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

I have docker installed on Ubuntu 18.04.2 with snap.我在 Ubuntu 18.04.2 上安装了 docker 和 snap。

When I try to start docker it fails with the following error log.当我尝试启动 docker 时,它失败并显示以下错误日志。

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?我应该怎么做才能让 docker 再次工作?

In this case, docker was waiting for containerd to start.在这种情况下,docker 正在等待 containerd 启动。 The containerd pid is located at containerd pid 位于

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

This pid didn't exist.这个pid不存在。 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.删除这个文件可以让containerd进程重新启动,问题就解决了。 I believe similar problems exist out there where docker.pid file also points to a non-existent pid.我相信存在类似的问题,其中 docker.pid 文件也指向不存在的 pid。

Ive also faced error while dialing: dial unix:///var/run/docker/containerd/containerd.sock: timeout on fresh docker install on Arch linux today.我在拨号时也遇到error while dialing: dial unix:///var/run/docker/containerd/containerd.sock: timeout今天在 Arch linux 上安装新的 docker 时超时。

Ive installed docker and tried to start it:我安装了 docker 并尝试启动它:

sudo systemctl enable docker
sudo systemctl start docker

It dont start: sudo systemctl status docker says:它不启动: sudo systemctl status docker说:

× docker.service - Docker Application Container Engine
 Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
 Active: failed (Result: exit-code) since Sun 2022-02-20 20:29:53 +03; 8s ago
TriggeredBy: × docker.socket
   Docs: https://docs.docker.com
Process: 8368 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 8368 (code=exited, status=1/FAILURE)
    CPU: 414ms

Feb 20 20:29:53 V-LINUX-087 systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Feb 20 20:29:53 V-LINUX-087 systemd[1]: Stopped Docker Application Container Engine.
Feb 20 20:29:53 V-LINUX-087 systemd[1]: docker.service: Start request repeated too quickly.
Feb 20 20:29:53 V-LINUX-087 systemd[1]: docker.service: Failed with result 'exit-code'.
Feb 20 20:29:53 V-LINUX-087 systemd[1]: Failed to start Docker Application Container Engine.

I managed to get more info after executing sudo dockerd :执行sudo dockerd后,我设法获得了更多信息:

$ sudo dockerd
INFO[2022-02-20T20:32:05.923357711+03:00] Starting up                                  
INFO[2022-02-20T20:32:05.924015767+03:00] libcontainerd: started new containerd process  pid=8618
INFO[2022-02-20T20:32:05.924036777+03:00] parsed scheme: "unix"                         module=grpc
INFO[2022-02-20T20:32:05.924043494+03:00] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2022-02-20T20:32:05.924058420+03:00] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2022-02-20T20:32:05.924068315+03:00] ClientConn switching balancer to "pick_first"  module=grpc
containerd: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by containerd)
ERRO[2022-02-20T20:32:05.924198775+03:00] containerd did not exit successfully          error="exit status 1" module=libcontainerd
WARN[2022-02-20T20:32:06.925000686+03:00] grpc: addrConn.createTransport failed to connect to {unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}. Err :connection error: desc = "transport: error while dialing: dial unix:///var/run/docker/containerd/containerd.sock: timeout". Reconnecting...  module=grpc
WARN[2022-02-20T20:32:09.397384787+03:00] grpc: addrConn.createTransport failed to connect to {unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}. Err :connection error: desc = "transport: error while dialing: dial unix:///var/run/docker/containerd/containerd.sock: timeout". Reconnecting...  module=grpc
WARN[2022-02-20T20:32:13.645272915+03:00] grpc: addrConn.createTransport failed to connect to {unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}. Err :connection error: desc = "transport: error while dialing: dial unix:///var/run/docker/containerd/containerd.sock: timeout". Reconnecting...  module=grpc
WARN[2022-02-20T20:32:19.417671818+03:00] grpc: addrConn.createTransport failed to connect to {unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}. Err :connection error: desc = "transport: error while dialing: dial unix:///var/run/docker/containerd/containerd.sock: timeout". Reconnecting...  module=grpc
failed to start containerd: timeout waiting for containerd to start

So it seems like containerd could not start in my case.因此,在我的情况下, containerd似乎无法启动。

I tried sudo containerd and voila :我试过sudo containerd

$ sudo containerd
containerd: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by containerd)

On my OS (Arch linux) the solution was to update the package:在我的操作系统 (Arch linux) 上,解决方案是更新 package:

sudo pacman -S lib32-glibc

If may be just sudo pacman -S glibc for someone on arch linux as weel如果可能只是sudo pacman -S glibc对于 arch linux 上的某个人作为 weel

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法启动docker daemon,无法连接做容器 - Cannot start docker daemon, failed to connect do containerd Docker 服务在重启后无法启动 - 无法启动 containerd - Docker service won't start after power cycle - Failed to start containerd Containerd:相当于 docker 在 containerd 中检查 - Containerd: Equivalent of docker inspect in containerd Dockerd 无法作为守护进程启动,并出现错误“exec:“docker-containerd”:$PATH 中找不到可执行文件” - Dockerd can't start as daemon with error "exec: "docker-containerd": executable file not found in $PATH" Docker CLI &amp; containerd 在 Windows - Docker CLI & containerd on Windows 连接容器失败 - Failed to connect to containerd 泊坞窗:来自守护进程的错误响应:连接错误:desc =“传输:拨打unix:///var/run/docker/containerd/docker-containerd.sock:超时” - docker: Error response from daemon: connection error: desc = "transport: dial unix:///var/run/docker/containerd/docker-containerd.sock: timeout" 无法连接到 containerd:拨号失败 - Failed to connect to containerd: failed to dial 来自守护进程的错误响应:启动 shim 失败:fork/exec /usr/bin/containerd-shim:打开的文件太多:未知 - Error response from daemon: failed to start shim: fork/exec /usr/bin/containerd-shim: too many open files: unknown 使用 containerd 在 Kubernetes 中运行 docker - Running docker inside Kubernetes with containerd
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM