CreateContainerError
Unlike CreateContainerConfigError (missing Kubernetes objects), this one comes from the container runtime itself, while it was creating the container.
Diagnose in order
Section titled “Diagnose in order”- Read the full event message. The runtime error is at the end of a long chain; the useful part usually follows
runc create failed:orOCI runtime create failed:. - If it’s about the command, compare the pod’s
commandandargswith what’s in the image: run the image locally with a shell, or usekubectl debugwith a copy of the pod and-- sh. - If it’s about a mount, check the volume and
subPathin the pod spec.
Usual causes
Section titled “Usual causes”| 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.