Skip to content

CreateContainerError

Unlike CreateContainerConfigError (missing Kubernetes objects), this one comes from the container runtime itself, while it was creating the container.

  1. Read the full event message. The runtime error is at the end of a long chain; the useful part usually follows runc create failed: or OCI runtime create failed:.
  2. If it’s about the command, compare the pod’s command and args with what’s in the image: run the image locally with a shell, or use kubectl debug with a copy of the pod and -- sh.
  3. If it’s about a mount, check the volume and subPath in the pod spec.
Message contains Cause
exec: "...": no such file or directory The command or entrypoint doesn’t exist in the image
permission denied on exec The file isn’t executable, or the image runs as a user that can’t execute it
not a directory / is a directory with a mount A subPath or file mount points at the wrong type of path
the container name ... is already in use A stale container from a previous attempt; usually clears on retry or after a kubelet restart

Fix the command or image, or the mount. For permission problems with restricted Pod Security, make sure the image is built to run as a non-root user rather than relaxing the policy.