Cannot kill container: <container-id>: tried to kill container, but did not receive an exit event
I cannot stop, remove or kill my docker container. Commands given below with their respective error messages:
1. docker stop <container-id>
2. docker kill <container-id>
3. docker rm <container-id>
I get
1. Error response from daemon: cannot stop container: <container-id>: tried to kill container, but did not receive an exit event
2. Error response from daemon: cannot kill container: <container-id>: tried to kill container, but did not receive an exit event
3. Error response from daemon: You cannot remove a running container <container-id>. Stop the container before attempting removal or force remove
Same error messages if i prefix everything with sudo and also the same messages if I run all of commands above with --force. How do I solve this? It seems like I can't stop, kill or remove the container because it does not "receive an exit event". Nothing here helps: Error response from daemon: cannot stop container - signaling init process caused "permission denied" .
Solution 1:
Some of the solutions that you can try:
- Restart the docker service:
sudo systemctl restart docker.service
- Restart the Host Machine
- Enter inside the container
docker exec -it ContainerName /bin/bash
and then Kill the containerkill 1
- You can disable the apparmor service so first check the status
sudo apparmor_status
then disable itsudo systemctl disable apparmor
then teardown the apparmorsudo service apparmor teardown
. Now check the status againsudo apparmor_status