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.
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.
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.
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()dockerfile parse error line 5: unknown instruction: RRUN
How to fix 'unknown instruction' Dockerfile parse error in Docker
Error response from daemon: manifest for nginx:nonexistent not found: manifest unknown: manifest unknown
How to fix 'manifest for image:tag not found' in Docker
Error response from daemon: invalid reference format: repository name must be lowercase
How to fix 'repository name must be lowercase' in Docker
Error response from daemon: No such image
How to fix 'No such image' in Docker
Error response from daemon: Container is not running
How to fix 'Container is not running' when using docker exec