moby: Cannot stop container XXXXXXXXXXXX: [2] Container does not exist: container destroyed

Docker fails to stop a container:

root@haswell:/home/supervisor# docker ps | grep e16
e16c5c80ab4e        ernetas/local:latest   "/sbin/my_init -- /b   10 days ago         Up 3 minutes                            romantic_kirch      
root@haswell:/home/supervisor# docker stop e16c5c80ab4e
Error response from daemon: Cannot stop container e16c5c80ab4e: [2] Container does not exist: container destroyed
FATA[0000] Error: failed to stop one or more containers 
root@haswell:/home/supervisor# 

Docker version and info:

supervisor@haswell:~$ sudo docker -D info
Containers: 8
Images: 40
Storage Driver: aufs
 Root Dir: /storage2/docker/aufs
 Backing Filesystem: extfs
 Dirs: 56
 Dirperm1 Supported: false
Execution Driver: native-0.2
Kernel Version: 3.13.0-45-generic
Operating System: Ubuntu 14.04.2 LTS
CPUs: 4
Total Memory: 31.35 GiB
Name: haswell
ID: T2LH:VCTV:CZGW:WBD6:7FQ6:TNLY:BEB4:ATGH:CBZZ:FEPU:JTRY:XNVQ
Debug mode (server): false
Debug mode (client): true
Fds: 35
Goroutines: 73
System Time: Fri Apr 24 11:45:27 EEST 2015
EventsListeners: 0
Init SHA1: 9145575052383dbf64cede3bac278606472e027c
Init Path: /usr/bin/docker
Docker Root Dir: /storage2/docker
supervisor@haswell:~$ sudo docker -D version
Client version: 1.6.0
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 4749651
OS/Arch (client): linux/amd64
Server version: 1.6.0
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): 4749651
OS/Arch (server): linux/amd64
supervisor@haswell:~$ 

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 2
  • Comments: 121 (60 by maintainers)

Commits related to this issue

Most upvoted comments

We had the same problem here today. The comment of @mpalmer did help a lot but not completely. We found out that you can do the following:

lscgroup | grep  <ID> | xargs cgdelete
docker restart <ID>
docker kill <ID>
docker rm <ID>

If you’ve got a container that just won’t die after you docker rm -f it, you can force-nuke it with

lscgroup | grep <shortID> | xargs cgdelete

Where <shortID> is the blob of hex that identifies the container in docker ps.

It’s not a fix, but it’s an effective workaround.

Did not work for us. The

lscgroup | grep <ID> | xargs cgdelete

command did delete the entries form lscgroup, but the container ist still in docker ps and all the 3 steps from @SirUrban did just fail as usual Container does not exist: container destroyed.

Docker engine restart fixes the problem for us, but this is not an acceptable workaround.

Just as an addition to the cases before. We triggered it a couple of times with using docker-compose up ..." and then killed it with double CTRL-C.

for the record:

$ docker kill 69ee03602684
Failed to kill container (69ee03602684): Error response from daemon: Cannot kill container 69ee03602684: [2] Container does not exist: container destroyed

$ lscgroup | grep 69ee03602684
cpuset:/docker/69ee036026840507c51897cb29d95367cdd3701db68d2338aa1f1d8a2ee67564
cpu:/docker/69ee036026840507c51897cb29d95367cdd3701db68d2338aa1f1d8a2ee67564
cpuacct:/docker/69ee036026840507c51897cb29d95367cdd3701db68d2338aa1f1d8a2ee67564
memory:/docker/69ee036026840507c51897cb29d95367cdd3701db68d2338aa1f1d8a2ee67564
devices:/docker/69ee036026840507c51897cb29d95367cdd3701db68d2338aa1f1d8a2ee67564
freezer:/docker/69ee036026840507c51897cb29d95367cdd3701db68d2338aa1f1d8a2ee67564
blkio:/docker/69ee036026840507c51897cb29d95367cdd3701db68d2338aa1f1d8a2ee67564
perf_event:/docker/69ee036026840507c51897cb29d95367cdd3701db68d2338aa1f1d8a2ee67564
hugetlb:/docker/69ee036026840507c51897cb29d95367cdd3701db68d2338aa1f1d8a2ee67564

# lscgroup | grep 69ee03602684 | xargs cgdelete

# lscgroup | grep 69ee03602684

# docker ps
CONTAINER ID        IMAGE                 COMMAND                   CREATED             STATUS              PORTS                         NAMES
69ee03602684        sessiondb_sink        "start-flume"             2 days ago          Up 2 days                                         sessiondb_sink_1

# docker restart 69ee03602684
Failed to kill container (69ee03602684): Error response from daemon: Cannot restart container 69ee03602684: [2] Container does not exist: container destroyed

@suchakra012 please don’t comment on closed issues with unrelated questions; if you suspect there’s a bug, open a new issue; for questions about running docker, either https://forums.docker.com, the #docker IRC channel, or StackOverflow are probably better

I think this steps will fix the ‘Destroyed Container’ 1. Try to stop all the container in the host. ( kill new process in containers) 2. Stop the docker daemon, 3. kill all the processes escaped from container which PPID is 1. 4. start your docker daemon.