How to fix Error response from daemon: Cannot unpause container: Container is not paused in Docker
This error occurs when you attempt to unpause a Docker container that is not in a paused state. Check the container's actual status with 'docker ps' and use the appropriate command for its current state.
Quick fix
Fixes Error response from daemon: Cannot unpause container: Container is not paused
docker ps -a --filter "name=<container_name>"- Check the container's current state
- Use the correct command for the container's state
- Handle the case in scripts gracefully
- Understand what happened to previously paused containers
docker ps -a --filter "name=<container_name>"Error response from daemon: Cannot unpause container: Container is not paused
What this error means
This error occurs when you run `docker unpause` on a container that is not currently paused. The full error message reads: "Error response from daemon: Cannot unpause container: Container is not paused". The `docker unpause` command is specifically designed to resume containers that have been suspended using `docker pause`. When a container is paused, Docker uses the Linux cgroups freezer to freeze all processes in place. The unpause command reverses this by unfreezing those processes. However, if the container is in any other state - running, stopped, exited, created, or restarting - the unpause command has no effect and Docker returns this error. This commonly happens when users confuse paused containers with stopped containers, or when a container's state changed between checking and unpausing.
Typical symptoms
- 'docker unpause' fails with 'Cannot unpause container: Container is not paused'
- Attempting to resume a container that was stopped instead of paused
- Scripts or automation tools failing when trying to unpause containers
- Confusion between stopped containers and paused containers
- Container is running normally but unpause command was issued by mistake
Common causes
- Container is currently running, not paused
- Container was stopped with 'docker stop' instead of paused with 'docker pause'
- Container exited on its own and is no longer running
- Container state changed between when you checked and when you ran unpause
- Confusion between pause/unpause and stop/start commands
- After a system or Docker daemon restart, previously paused containers become stopped
How to fix "Error response from daemon: Cannot unpause container: Container is not paused"
First, verify the actual state of your container:
docker ps -a --filter "name=<container_name>"Look at the STATUS column to understand the container's current state:
| Status | Meaning | Correct Command |
|--------|---------|-----------------|
| Up X minutes | Running normally | No action needed |
| Up X minutes (Paused) | Paused | docker unpause |
| Exited (0) | Stopped cleanly | docker start |
| Exited (1) | Stopped with error | docker start or docker logs |
| Created | Never started | docker start |
You can also inspect the pause state directly:
docker inspect <container_name> --format='{{.State.Status}} (Paused: {{.State.Paused}})'Based on the container's actual state, use the appropriate command:
If the container is stopped or exited:
docker start <container_name>If the container is already running:
No action is needed - the container is already operational. Verify it's working:
docker ps
docker logs <container_name>If you actually want to pause and then unpause:
# First pause the container
docker pause <container_name>
# Then unpause when ready
docker unpause <container_name>If you're automating container management, check the state before attempting to unpause:
#!/bin/bash
CONTAINER_NAME="my_container"
# Get container state
STATE=$(docker inspect "$CONTAINER_NAME" --format='{{.State.Status}}' 2>/dev/null)
PAUSED=$(docker inspect "$CONTAINER_NAME" --format='{{.State.Paused}}' 2>/dev/null)
case "$STATE" in
"running")
if [ "$PAUSED" = "true" ]; then
echo "Container is paused, unpausing..."
docker unpause "$CONTAINER_NAME"
else
echo "Container is already running"
fi
;;
"exited"|"created")
echo "Container is stopped, starting..."
docker start "$CONTAINER_NAME"
;;
*)
echo "Container state: $STATE"
;;
esacThis prevents the error by checking the state first.
If you expected a container to be paused but it's not, consider these scenarios:
After a system restart:
Paused containers do not survive reboots. When Docker restarts, previously paused containers will be in a stopped state. You need to use docker start instead.
After Docker daemon restart:
Similarly, restarting the Docker daemon (via systemctl restart docker or Docker Desktop restart) will stop all paused containers.
To verify:
# Check when Docker was last started
systemctl show docker --property=ActiveEnterTimestamp
# Check container's last state change
docker inspect <container_name> --format='{{.State.FinishedAt}}'If the container stopped around the time Docker restarted, that explains why it's no longer paused.
Advanced notes
Understanding Docker container states: Docker containers can be in several states, and each has specific commands that apply:
| State | Description | Valid Operations |
|-------|-------------|------------------|
| created | Container exists but never started | start, rm |
| running | Container is running normally | pause, stop, kill, exec, attach |
| paused | Container is frozen (via cgroups) | unpause, stop (after unpause) |
| exited | Container has stopped | start, rm, logs |
| restarting | Container is restarting | wait, logs |
| dead | Container failed to stop properly | rm -f |
Pause vs Stop - Key differences:
- docker pause: Uses cgroups freezer to freeze processes in place. Memory is preserved, state is frozen. Instant resume with unpause.
- docker stop: Sends SIGTERM (then SIGKILL after timeout). Process terminates, memory released. Requires full start to resume.
Docker Compose considerations:
If you're using Docker Compose, note that docker compose unpause in Compose V2 will error if services aren't paused, whereas V1 silently ignored this. Handle this in CI/CD scripts:
# Safe unpause for Compose V2
docker compose unpause 2>/dev/null || trueProgrammatic state checking:
When building automation, use the Docker API or inspect command to check state before operations:
import docker
client = docker.from_env()
container = client.containers.get("my_container")
if container.status == "running" and container.attrs["State"]["Paused"]:
container.unpause()
elif container.status == "exited":
container.start()Frequently asked questions
- What does "Error response from daemon: Cannot unpause container: Container is not" mean?
- This error occurs when you run docker unpause on a container that is not currently paused. The full error message reads: "Error response from daemon: Cannot unpause container: Container is not paused". The docker unpause command is specifically designed to resume containers that have been suspended using docker pause.
- How do I fix "Error response from daemon: Cannot unpause container: Container is not"?
- This error occurs when you attempt to unpause a Docker container that is not in a paused state. Check the container's actual status with 'docker ps' and use the appropriate command for its current state.
- What causes "Error response from daemon: Cannot unpause container: Container is not"?
- Container is currently running, not paused Container was stopped with 'docker stop' instead of paused with 'docker pause' Container exited on its own and is no longer running
- Is the "Error response from daemon: Cannot unpause container: Container is not" error serious?
- It is a low-severity error โ more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- ๐Docker Official Documentation
- ๐docker container unpause | Docker Docs(Official Docs)
- ๐docker container pause | Docker Docs(Official Docs)
- ๐docker compose unpause | Docker Docs(Official Docs)
- ๐ฌpause vs stop in docker - Stack Overflow(Stack Overflow)
- ๐ฌStopping paused Docker containers - Stack Overflow(Stack Overflow)
- ๐
- ๐