Skip to content
Latchkey

Kubernetes "CreateContainerError" on deploy in CI - Fix it

CreateContainerError is a runtime-level failure: the image is present and the config resolved, but containerd/CRI could not actually create the container. The describe message carries the specific cause.

What this error means

The pod sits in CreateContainerError. kubectl describe pod shows a kubelet message such as Error: failed to create containerd container, a duplicate container name, or a bad working directory / executable.

kubectl
Warning  Failed  kubelet  Error: failed to create containerd task: OCI
runtime create failed: exec: "/app/start": stat /app/start: no such file or directory

Common causes

Bad command, args, or workingDir

The command/args reference a binary or path that does not exist in the image, or workingDir points at a directory that is not present.

Runtime-level conflict

A duplicate container name, a hostPath that does not exist, or a CRI/containerd error prevents container creation even though scheduling and image pull succeeded.

How to fix it

Read the kubelet error

The message after Error: in describe is the precise runtime failure.

Terminal
kubectl describe pod <pod> | sed -n '/Events/,$p'

Correct the spec

  1. If the entrypoint/binary path is wrong, fix command/args to match what is in the image (docker run --entrypoint sh <image> to inspect).
  2. Ensure workingDir and any hostPath mounts exist in the image/node.
  3. Re-apply and confirm the container is created.

How to prevent it

  • Test the exact image+command locally before deploying.
  • Avoid hostPath mounts in CI deploys; prefer ConfigMap/emptyDir.
  • Keep entrypoints in the image (ENTRYPOINT) rather than overriding command in the manifest where possible.

Frequently asked questions

What causes ""CreateContainerError""?
The command/args reference a binary or path that does not exist in the image, or workingDir points at a directory that is not present.
How do I fix "CreateContainerError"?
The message after Error: in describe is the precise runtime failure.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card