moby / moby

The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
https://mobyproject.org/
Apache License 2.0
68.72k stars 18.67k forks source link

rpc error: code = 2 desc = containerd: container not found #40352

Closed loretoparisi closed 4 years ago

loretoparisi commented 4 years ago
docker ps -a
d61ee6290610        musixmatch/mycontainer_name   "python3 tornadoaa..."   3 days ago          Up 3 days           8888/tcp                           mycontainer_image
$ docker exec -it d61ee6290610 bash
rpc error: code = 2 desc = containerd: container not found
$ docker top d61ee6290610
rpc error: code = 2 desc = containerd: container not found

Only using docker logs d61ee6290610 I can see the logging of this container. Also I cannot stop the container:

docker stop d61ee6290610

there is no output and the container is still there:

docker ps -a
d61ee6290610        musixmatch/mycontainer_name   "python3 tornadoaa..."   3 days ago          Up 3 days           8888/tcp                           mycontainer_image

My docker info was

$ docker info
Containers: 4
 Running: 4
 Paused: 0
 Stopped: 0
Images: 5
Server Version: 1.13.1
Storage Driver: overlay2
 Backing Filesystem: xfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local efs
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1
runc version: 9df8b306d01f59d3a8029be411de015b7304dd8f
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-170-generic
Operating System: Ubuntu 16.04.6 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 59.97 GiB
Name: xxxxx
ID: xxxxx
Docker Root Dir: /mnt/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

and

$ docker version
Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 06:50:14 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.13.1
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 06:50:14 2017
 OS/Arch:      linux/amd64
 Experimental: false
$ uname -a
Linux ai-tools-base-i-02bb8a222da834db8 4.4.0-170-generic #199-Ubuntu SMP Thu Nov 14 01:45:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

I'm not sure if this issue could be related to https://github.com/moby/moby/issues/22357 or https://github.com/moby/moby/issues/18180

The only workaround I have found was brutal:

sudo service docker stop
sudo service docker start
thaJeztah commented 4 years ago

You seem to be running a really old version of Docker. Docker 1.13.1 reached EOL in March 2017 (when Docker 17.03.0 was released), and hasn't been maintained since.

I'd highly recommend upgrading to a current version, because the version you're running has known, unpatched vulnerabilities, some of which critical (including container escapes).

When upgrading, you may have to change the repository you're installing from; the apt.dockerproject.org package repository that has docker 1.13.1 (http://apt.dockerproject.org/repo/pool/main/d/docker-engine/) has been replaced with a new repository (download.docker.com), so current packages can be found in that repository.

Instructions for installing a current version can be found in the docs: https://docs.docker.com/install/linux/docker-ce/ubuntu/

Note however, that skipping versions when upgrading is generally not recommended (at least, upgrading from very old versions is not tested), so be sure to backup important data (e.g. volumes) and test the upgrade in a test-environment if possible.

I'm closing this issue because of the above, but feel free to continue the conversation

oldthreefeng commented 3 years ago

docker version 17.06.2-ce-5 meet the same question. @thaJeztah

$ docker ps -a | grep algo
ffea5723e1c3        registry-vpc.cn-hangzhou.aliyuncs.com/learnta/be_algorithm_service_staging.protect   "/bin/bash /entryp..."   5 days ago          Up 5 days                                       k8s_be-algorithm-service-container_be-algorithm-service-565d9d9666-m8kt6_staging_ba6620ed-ad23-4eca-b483-c31af8ea60fa_0
$ docker exec -it ffea5723e1c3 /bin/bash
rpc error: code = 2 desc = containerd: container not found

$  docker info 
Containers: 197
 Running: 115
 Paused: 0
 Stopped: 82
Images: 58
Server Version: 17.06.2-ce-5
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: systemd
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 6e23458c129b551d5c9871e5174f6b1b7f6d1170
runc version: fc48a25bde6fb041aae0977111ad8141ff396438
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-1160.15.2.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 31.26GiB
Name: k8s-node-217-246
ID: WRN4:QCU7:XEQD:6HT7:QU3E:4HRH:45MC:KCEQ:4K4N:BOJU:C5OW:OXD7
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Registry Mirrors:
 https://pqbap4ya.mirror.aliyuncs.com/
Live Restore Enabled: true
thaJeztah commented 3 years ago

Docker 17.06 is also deprecated, and reached EOL 4 years ago