How to fix failed to create containerd task: failed to create shim task in Docker

DockerINTERMEDIATEHIGHUpdated Sep 21, 2026ยท 363 views

The 'failed to create containerd task: failed to create shim task' error occurs when Docker's containerd runtime cannot initialize the container process. This is typically caused by service issues, permission problems, corrupted containers, or version incompatibilities between containerd and runc.

Quick fix

Fixes failed to create containerd task: failed to create shim task

# Check containerd status
sudo systemctl status containerd

# If not running, start it
sudo systemctl start containerd

# Check for errors in the logs
sudo journalctl -u containerd -n 50 --no-pager
  1. Check containerd service status
  2. Restart Docker and containerd services
  3. Clean up corrupted container state
  4. Check file system and disk space
docker โ€” error
# Check containerd status
sudo systemctl status containerd
# If not running, start it
sudo systemctl start containerd
# Check for errors in the logs
sudo journalctl -u containerd -n 50 --no-pager
failed to create containerd task: failed to create shim task

What this error means

This error indicates that Docker's underlying container runtime (containerd) failed to create the necessary task and shim process required to start your container. The containerd shim is a small process that acts as an intermediary between containerd and the actual container runtime (runc). When you see this error, it means the container startup sequence failed at a critical point - after the image was pulled but before the container process could actually be spawned. The shim process is responsible for handling stdin/stdout/stderr for the container and keeping the container running even if containerd restarts. The full error often includes additional context like "OCI runtime create failed" or "runc create failed", which points to the specific component that encountered the issue. Common root causes include containerd service not running properly, file system or permission issues, corrupted container state, or version mismatches between Docker components.

Typical symptoms

  • Containers fail to start with 'failed to create containerd task' error
  • Docker run or docker-compose commands exit with shim task creation errors
  • Kubernetes pods stuck in ContainerCreating or RunContainerError state
  • Error message includes 'OCI runtime create failed' or 'runc create failed'
  • Containers that previously worked suddenly fail to start after system updates
  • Intermittent container start failures under high load

Common causes

  1. Containerd service is not running or has crashed
  2. Corrupted container state or Docker overlay2 filesystem issues
  3. Insufficient permissions to access Docker socket or container resources
  4. Version incompatibility between containerd and runc after updates
  5. SELinux or AppArmor blocking container creation
  6. Resource exhaustion (disk space, memory, or file descriptors)
  7. Process namespace issues (stale /proc references)
  8. Container image incompatibility with host OS (especially on Windows)

How to fix "failed to create containerd task: failed to create shim task"

1Check containerd service status

First, verify that the containerd service is running properly:

bash
# Check containerd status
sudo systemctl status containerd

# If not running, start it
sudo systemctl start containerd

# Check for errors in the logs
sudo journalctl -u containerd -n 50 --no-pager

If containerd shows as failed or inactive, check the logs for specific error messages that indicate the root cause.

2Restart Docker and containerd services

A service restart often resolves transient issues:

bash
# Restart both services
sudo systemctl restart containerd
sudo systemctl restart docker

# Verify both are running
sudo systemctl status containerd docker

Wait a few seconds after restarting before attempting to run containers again.

3Clean up corrupted container state

Corrupted containers or Docker state can cause shim creation failures:

bash
# Stop all running containers
docker stop $(docker ps -q) 2>/dev/null

# Remove all stopped containers
docker container prune -f

# Clean up unused images and networks
docker system prune -f

# For more aggressive cleanup (removes unused volumes too)
docker system prune -a --volumes -f

Warning: The last command removes all unused volumes. Only use if you don't need to preserve volume data.

4Check file system and disk space

Insufficient disk space or filesystem issues can prevent container creation:

bash
# Check available disk space
df -h /var/lib/docker
df -h /var/lib/containerd

# Check for filesystem errors (if possible)
sudo touch /var/lib/docker/.test && sudo rm /var/lib/docker/.test

Docker typically requires at least 1-2GB of free space. If space is low, clean up old images and containers.

5Verify runc and containerd versions

Version mismatches can cause compatibility issues:

bash
# Check versions
docker version
containerd --version
runc --version

# If versions are mismatched after an update, consider:
# 1. Update all components together
sudo apt update && sudo apt upgrade docker-ce docker-ce-cli containerd.io

# 2. Or rollback to a known working version
# (check your package manager for available versions)

Known problematic versions include containerd 2.0.x with older Docker versions, and containerd 1.7.24.x which had reported issues.

6Check SELinux or AppArmor settings

Security modules can block container creation:

bash
# Check SELinux status (RHEL/CentOS/Fedora)
getenforce

# Temporarily set to permissive for testing
sudo setenforce 0

# Check AppArmor status (Ubuntu/Debian)
sudo aa-status

# Check Docker's AppArmor profile
sudo aa-status | grep docker

If disabling security modules fixes the issue, configure proper policies rather than leaving them disabled permanently.

7Re-pull the container image

A corrupted or incompatible image can cause shim failures:

bash
# Remove the existing image
docker rmi <image-name>

# Pull a fresh copy
docker pull <image-name>

# Try running the container again
docker run <image-name>

If using a custom image, verify it was built correctly and is compatible with your host system.

Advanced notes

### Debugging with containerd directly

For deeper investigation, you can interact with containerd directly using ctr:

bash
# List containerd namespaces
sudo ctr namespaces list

# List containers in the moby namespace (Docker's namespace)
sudo ctr -n moby containers list

# Check containerd events
sudo ctr events

### Proxmox LXC containers

When running Docker inside Proxmox LXC containers, you may encounter this error due to AppArmor restrictions. Add the following to your LXC config:

bash
lxc.apparmor.profile: unconfined

Or configure proper nesting support for Docker in the Proxmox UI.

### Kubernetes-specific troubleshooting

For Kubernetes clusters using containerd:

bash
# Check kubelet logs for more details
journalctl -u kubelet -f

# Describe the failing pod
kubectl describe pod <pod-name>

# Check containerd config
cat /etc/containerd/config.toml

### Common version-specific issues

- containerd 2.0.x: May have compatibility issues with older Docker versions
- containerd 1.7.24.1: Reported "can't get final child's PID from pipe: EOF" issues
- runc 1.1.x: Namespace path errors under high load with older containerd versions

Consider pinning versions if you encounter stability issues after updates.

Frequently asked questions

What does "failed to create containerd task: failed to create shim task" mean?
This error indicates that Docker's underlying container runtime (containerd) failed to create the necessary task and shim process required to start your container. The containerd shim is a small process that acts as an intermediary between containerd and the actual container runtime (runc). When you see this error, it means the container startup sequence failed at a critical point - after the image was pulled but before the container process could actually be spawned.
How do I fix "failed to create containerd task: failed to create shim task"?
The 'failed to create containerd task: failed to create shim task' error occurs when Docker's containerd runtime cannot initialize the container process. This is typically caused by service issues, permission problems, corrupted containers, or version incompatibilities between containerd and runc.
What causes "failed to create containerd task: failed to create shim task"?
Containerd service is not running or has crashed Corrupted container state or Docker overlay2 filesystem issues Insufficient permissions to access Docker socket or container resources
Is the "failed to create containerd task: failed to create shim task" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading