When trying to stop or restart a docker container I\'m getting the following error message:
$ docker restart 5ba0a86f36ea
Error response from daemon: Cannot rest
That looks like docker/docker/issues/12738, seen with docker 1.6 or 1.7:
Some container fail to stop properly, and the restart
We are seeing this issue a lot in our users hosts when they upgraded from 1.5.0 to 1.6.0.
After the upgrade, some containers cannot be stopped (giving500 Server Error: Internal Server Error ("Cannot stop container xxxxx: [2] Container does not exist: container destroyed"
)) or forced destroyed (giving500 Server Error: Internal Server Error ("Could not kill running container, cannot remove - [2] Container does not exist: container destroyed"
)). The processes are still running on the host.
Sometimes, it works after restarting the docker daemon.
There are some workarounds:
I've tried all remote API calls for that unkillable container and here are results:
json
,stats
,changes
,top
,logs
returned valid responsesstop
,pause
,wait
,kill
reported 404 (!)After I finished with remote API, I double-checked
docker ps
(the container was still there), but then I retried docker kill and it worked! The container got killed and I could remove it.
Or:
What worked was to restart
boot2docker
on my host. Thendocker rm -f
$ boot2docker stop
$ boot2docker start
$ docker rm -f 1f061139ba04