合 docker启动容器报错:Error response from daemon task xxxx already exists
Tags: 故障处理Dockeralready exists
现象
由于主机磁盘空间不足,但是经过查询,docker并没有占用很大空间,也就是说du和df查出来的空间差异很大,这可能是deleted的文件很多导致,只能重启docker或重启主机了。
这里,我强制重启docker后,就不能启动容器,报错:
1 2 3 | [root@mdw ~]# docker start a03d68768b33 Error response from daemon: failed to create task for container: task a03d68768b33663cd8ce952233ef7e2e23a18fdcecfb542988bb3b65c5b03b94: already exists Error: failed to start containers: a03d68768b33 |
原因
原因:容器未安全退出
解决
解决方式一
需要杀掉moby的进程:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | [root@mdw ~]# ps -ef|grep moby root 469348 1 0 09:01 ? 00:00:00 /usr/bin/containerd-shim-runc-v2 -namespace moby -id a03d68768b33663cd8ce952233ef7e2e23a18fdcecfb542988bb3b65c5b03b94 -address /run/containerd/containerd.sock root 473685 1 0 09:02 ? 00:00:00 /usr/bin/containerd-shim-runc-v2 -namespace moby -id ff24f887858d3fd4d06e10ab51de56a3821fcdb645c935c3691685ae000984e1 -address /run/containerd/containerd.sock root 475664 1 0 09:02 ? 00:00:00 /usr/bin/containerd-shim-runc-v2 -namespace moby -id 369c51304911b2d465cdd8d815c6c200a47898f07b2e23300cd03401df85e3de -address /run/containerd/containerd.sock root 477883 1 0 09:03 ? 00:00:00 /usr/bin/containerd-shim-runc-v2 -namespace moby -id f9515d8c4756912549e05f953a9c38952d84075c220e37f8747740a17e2c8cc3 -address /run/containerd/containerd.sock root 480714 1 0 09:03 ? 00:00:00 /usr/bin/containerd-shim-runc-v2 -namespace moby -id 9feaa1008aa0552949eadfc7c7d20885058a8375f99378bb0b20246e2261d843 -address /run/containerd/containerd.sock root 485393 1 0 09:04 ? 00:00:00 /usr/bin/containerd-shim-runc-v2 -namespace moby -id e0ef2f29aa9072e08d081d3e8aa50f8b2dacb991b1452328113b88dbe3dd6ff5 -address /run/containerd/containerd.sock root 488109 1 0 09:05 ? 00:00:00 /usr/bin/containerd-shim-runc-v2 -namespace moby -id e664cb6eede1e15258060fdd7d9d718d35471c1ba10b7a1bc03a66e1a86746ea -address /run/containerd/containerd.sock root 490354 1 0 09:05 ? 00:00:00 /usr/bin/containerd-shim-runc-v2 -namespace moby -id 99c3d6648eab0c2e0eb505bf8327ac6b35a0d45594bcfa822f07928ab37b9485 -address /run/containerd/containerd.sock root 493993 1 0 09:06 ? 00:00:00 /usr/bin/containerd-shim-runc-v2 -namespace moby -id e53beae6b9c83b6c0b82d6ddc2e19e9c151a0e2d2aeecc73b9f70315bb0f47ca -address /run/containerd/containerd.sock root 512287 1 0 09:13 ? 00:00:00 /usr/bin/containerd-shim-runc-v2 -namespace moby -id db294830a440093dbb98eefe9c254cd3f5aa1b69efe95660c00ecbba4166454e -address /run/containerd/containerd.sock root 512483 1 0 09:13 ? 00:00:00 /usr/bin/containerd-shim-runc-v2 -namespace moby -id 042c625d3522ac6fc7e47a79c1d31c596c53f9f916341aa8d1b3f933dc9ba733 -address /run/containerd/containerd.sock root 527036 503026 0 09:25 pts/1 00:00:00 grep --color=auto moby [root@mdw ~]# [root@mdw ~]# kill -9 469348 [root@mdw ~]# kill -9 473685 [root@mdw ~]# kill -9 475664 [root@mdw ~]# kill -9 477883 [root@mdw ~]# kill -9 480714 [root@mdw ~]# kill -9 485393 [root@mdw ~]# kill -9 488109 [root@mdw ~]# kill -9 490354 [root@mdw ~]# kill -9 493993 [root@mdw ~]# kill -9 512287 [root@mdw ~]# kill -9 512483 [root@mdw ~]# kill -9 527036 |