docker启动失败问题解决

docker启动失败问题:

使用journalctl -u docker.service命令排查

[root@harbor ~]# journalctl -u docker.service

9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.867557425+08:00" level=error msg="getNetworkFromStore for nid 2d2846e7cfae65f5d0
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.867577522+08:00" level=info msg="Removing stale sandbox aaf0f795b6ca14b5f5a053c9
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.867590703+08:00" level=warning msg="Failed getting network for ep fb948a7be2daff
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.867599811+08:00" level=error msg="Failed to delete sandbox aaf0f795b6ca14b5f5a05
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.903390601+08:00" level=error msg="getNetworkFromStore for nid 2d2846e7cfae65f5d0
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.903416078+08:00" level=info msg="Removing stale sandbox c3bfffb19e4e6af47cf89e63
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.903431992+08:00" level=warning msg="Failed getting network for ep a0d52c35e33999
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.903439347+08:00" level=error msg="Failed to delete sandbox c3bfffb19e4e6af47cf89
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.940036472+08:00" level=error msg="getNetworkFromStore for nid 2d2846e7cfae65f5d0
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.940052661+08:00" level=info msg="Removing stale sandbox e36898c45c8b7439d238dc4a
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.940063980+08:00" level=warning msg="Failed getting network for ep 744e29521355f7
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.940070801+08:00" level=error msg="Failed to delete sandbox e36898c45c8b7439d238d
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.975876838+08:00" level=error msg="getNetworkFromStore for nid 2d2846e7cfae65f5d0
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.975900486+08:00" level=info msg="Removing stale sandbox 6e93d6e7d87c1b670d50b15a
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.975916308+08:00" level=warning msg="Failed getting network for ep d667ac43c8f7b9
9月 06 10:02:04 harbor dockerd[6218]: time="2023-09-06T10:02:04.975923312+08:00" level=error msg="Failed to delete sandbox 6e93d6e7d87c1b670d50b
9月 06 10:02:05 harbor dockerd[6218]: time="2023-09-06T10:02:05.012352707+08:00" level=error msg="getNetworkFromStore for nid 2d2846e7cfae65f5d0
9月 06 10:02:05 harbor dockerd[6218]: time="2023-09-06T10:02:05.012369170+08:00" level=info msg="Removing stale sandbox 7f43de464da7343f6cdee325
9月 06 10:02:05 harbor dockerd[6218]: time="2023-09-06T10:02:05.012380940+08:00" level=warning msg="Failed getting network for ep 251a6b9162660f
9月 06 10:02:05 harbor dockerd[6218]: time="2023-09-06T10:02:05.012387607+08:00" level=error msg="Failed to delete sandbox 7f43de464da7343f6cdee
9月 06 10:02:05 harbor dockerd[6218]: time="2023-09-06T10:02:05.048891483+08:00" level=error msg="getNetworkFromStore for nid 2d2846e7cfae65f5d0
9月 06 10:02:05 harbor dockerd[6218]: time="2023-09-06T10:02:05.048911524+08:00" level=info msg="Removing stale sandbox 876ba6df0fe1a8b73ddb5932

可以通过日志看到很明显的错误
报错为error:getNetworkFromStore for nid failed while trying to build sandbox for cleanup: network

解决docker启动问题:

备份并删除/var/lib/docker/network/files/local-kv.db文件

mv /var/lib/docker/network/files/local-kv.db /tmp

重启启动docker daemon服务

systemctl daemon-reload
systemctl restart docker

harbor启动失败问题

直接docker-composer up -d 启动时报错

[root@harbor harbor]# docker-compose up -d

Creating network "harbor_harbor" with the default driver
Starting harbor-log ... error

ERROR: for harbor-log  Cannot start service log: b'network 2d2846e7cfae65f5d019cbf8c0035a7869c521cd5eebd447029f80d16335fede not found'

ERROR: for log  Cannot start service log: b'network 2d2846e7cfae65f5d019cbf8c0035a7869c521cd5eebd447029f80d16335fede not found'
ERROR: Encountered errors while bringing up the project.

解决harbor:先down后再up启动

/usr/local/bin/docker-compose down
/usr/local/bin/docker-compose up -d

你可能感兴趣的:(docker)