Skip to content
Latchkey

Docker "failed to create shim task" runtime error in CI

containerd starts each container through a shim process that manages the OCI task. When the shim cannot be created - a transient containerd hiccup, a missing or broken runc, or resource pressure spawning the process - the container fails to start with failed to create shim task. The transient form clears on retry; a structural one (missing runtime) does not.

What this error means

A container start fails with Error response from daemon: failed to create shim task. Sometimes a wrapped OCI runtime message follows.

docker
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: unable to start container process: error during container init

Common causes

A transient containerd/shim spawn failure

Resource pressure or a momentary containerd issue can fail the shim creation for one start.

A missing or broken OCI runtime

If runc is absent or incompatible, every shim/task creation fails - that is structural, not transient.

How to fix it

Re-run the container start

  1. Retry - a one-off shim creation failure is usually transient.
  2. If it recurs every time, the runtime is broken (see next fix).
Terminal
docker run --rm myorg/api:1.4.2

Verify the OCI runtime is installed

  1. Confirm runc is present and runnable.
  2. Reinstall the runtime if it is missing or broken.
Terminal
runc --version
docker info | grep -i runtime

How to prevent it

  • Keep containerd and runc healthy and up to date.
  • Avoid host resource exhaustion during heavy container churn.
  • Retry transient shim-task failures before deeper debugging.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →