我是靠谱客的博主 不安眼神,最近开发中收集的这篇文章主要介绍docker报错rpc error: code = 14 desc = grpc: the connection is unavailabledocker报错rpc error: code = 14 desc = grpc: the connection is unavailable,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

docker报错rpc error: code = 14 desc = grpc: the connection is unavailable

实验环境

操作系统:CentOS Linux release 7.4.1708 (Core)
docker版本:1.13.1

场景还原

在尝试强制删除正在运行的容器时报错:

[root@localhost ~]# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                      NAMES
3e22bd0b6a40        mongo:3.2           "docker-entrypoint..."   19 hours ago        Up 19 hours         0.0.0.0:20002->27017/tcp   zen_mclean
[root@localhost ~]# docker rm 3e22bd0b6a40 -f
Error response from daemon: Cannot kill container 3e22bd0b6a40c85d2af45b5d65fb3648acab7e0ad05fa909201051a8f00a3d15: rpc error: code = 14 desc = grpc: the connection is unavailable

尝试关闭容器,进入容器操作界面也报相同错误:

[root@localhost ~]# docker stop 3e22bd0b6a40
Error response from daemon: Cannot stop container 3e22bd0b6a40: Cannot kill container 3e22bd0b6a40c85d2af45b5d65fb3648acab7e0ad05fa909201051a8f00a3d15: rpc error: code = 14 desc = grpc: the connection is unavailable
[root@localhost ~]# docker exec -it 3e22bd0b6a40 /bin/bash
rpc error: code = 14 desc = grpc: the connection is unavailable

尝试使用start命令启动容器,再删除容器,依然无效:

[root@localhost ~]# docker start zen_mclean
zen_mclean
[root@localhost ~]# docker rm -f zen_mclean 
Error response from daemon: Could not kill running container 3e22bd0b6a40c85d2af45b5d65fb3648acab7e0ad05fa909201051a8f00a3d15, cannot remove - Cannot kill container 3e22bd0b6a40c85d2af45b5d65fb3648acab7e0ad05fa909201051a8f00a3d15: rpc error: code = 14 desc = grpc: the connection is unavailable
[root@localhost ~]# docker exec -it 3e22bd0b6a40 /bin/bash
rpc error: code = 14 desc = grpc: the connection is unavailable

最后使用docker-containerd命令以debug模式调试容器:

[root@localhost ~]# docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc --debug
WARN[0000] containerd: low RLIMIT_NOFILE changing to max  current=1024 max=4096
DEBU[0000] containerd: read past events                  count=2
ERRO[0000] containerd: notify OOM events                 error=open /proc/4153/cgroup: no such file or directory
DEBU[0000] containerd: container restored                id=3e22bd0b6a40c85d2af45b5d65fb3648acab7e0ad05fa909201051a8f00a3d15
DEBU[0000] containerd: supervisor running                cpus=1 memory=975 runtime=docker-runc runtimeArgs=[] stateDir=/var/run/docker/libcontainerd/containerd
DEBU[0000] containerd: process exited                    id=3e22bd0b6a40c85d2af45b5d65fb3648acab7e0ad05fa909201051a8f00a3d15 pid=init status=137 systemPid=4153
DEBU[0000] containerd: grpc api on /var/run/docker/libcontainerd/docker-containerd.sock 
ERRO[0000] containerd: deleting container                error=exit status 1: "container 3e22bd0b6a40c85d2af45b5d65fb3648acab7e0ad05fa909201051a8f00a3d15 does not existnone or more of the container deletions failedn"





^CINFO[1971] stopping containerd after receiving interrupt 

调试后发现容器状态变为了未开启,尝试删除容器,成功

[root@localhost ~]# docker exec -it 3e22bd0b6a40 /bin/bash
Error response from daemon: Container 3e22bd0b6a40c85d2af45b5d65fb3648acab7e0ad05fa909201051a8f00a3d15 is not running
[root@localhost ~]# docker rm -f zen_mclean 
zen_mclean
[root@localhost ~]# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

总结

这次错误是由于偷懒,直接关闭开启中的容器导致的。以后要先关闭容器,再删除。

最后

以上就是不安眼神为你收集整理的docker报错rpc error: code = 14 desc = grpc: the connection is unavailabledocker报错rpc error: code = 14 desc = grpc: the connection is unavailable的全部内容,希望文章能够帮你解决docker报错rpc error: code = 14 desc = grpc: the connection is unavailabledocker报错rpc error: code = 14 desc = grpc: the connection is unavailable所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(33)

评论列表共有 0 条评论

立即
投稿
返回
顶部