Introduction

Kubernetes CreateContainerError means the Pod reached a node, the image and container config were usable enough to attempt creation, and the runtime failed before the process could run. Treat the status as a pointer, not a diagnosis: the Failed event tail names the mount, cgroup, device, policy, or spec fault.

Illustrative composite: a checkout API rolls out at 02:40 and three new Pods sit at 0/1 CreateContainerError with zero restarts. The image pulled cleanly, so the team first suspects the registry, then the application. kubectl describe pod tells a different story: failed to create containerd task: OCI runtime create failed: error mounting "/run/secrets" to rootfs: no such file or directory. The release changed a subPath mount to a file that the Secret no longer contains. The application never started, so application logs were the wrong place to look.

That pattern is the whole discipline of this status. CreateContainerError sits after scheduling and image pull, at the boundary where kubelet asks the container runtime interface to create a container and the runtime asks the OCI runtime to build namespaces, cgroups, mounts, devices, and security labels. If that construction fails, the container has no process, no logs, and no restart history. Your evidence is the Pod event, the container status message, kubelet logs, runtime logs, and the node state underneath them.

This guide separates runtime create failures from config assembly failures, image pull failures, start failures, and crash loops. It then maps the common error tails to fixes that match the layer at fault. If the container did start and exit, use the CrashLoopBackOff guide instead; if the image never arrived, use the ImagePullBackOff guide.


1. Kubernetes CreateContainerError: read the Failed event tail first

For Kubernetes CreateContainerError, start with kubectl describe pod and read the last clause of the Failed event before changing anything. The status only says creation failed. The event tail separates a missing mount path from a cgroup write rejection, a device allocation miss, a security denial, or an invalid runtime specification.

Run the smallest evidence set first:

bash
kubectl get pod <pod> -n <namespace> -o wide
kubectl describe pod <pod> -n <namespace>
kubectl get events -n <namespace> --sort-by=.lastTimestamp | tail -30
kubectl get pod <pod> -n <namespace> -o jsonpath='{range .status.containerStatuses[*]}{.name}{" "}{.state.waiting.reason}{" "}{.state.waiting.message}{"\n"}{end}'

Read the message from the end backwards. Runtime errors arrive wrapped: kubelet reports a failed container start, containerd reports a failed task or shim, and runc reports the operation that actually failed. A message ending in no such file or directory points at a path. A message ending in permission denied points at file mode, capabilities, or a security module. A message ending in invalid argument often points at a cgroup write, a namespace option, or a runtime spec field the kernel or runtime rejected.

Do not start with kubectl logs. There is no container process to log from, and --previous only helps after a container has run and terminated. Do not delete the Pod as your first move either. Deletion destroys the event context and usually recreates the same failure on the same or another node. Capture the node name, container name, image digest, event message, and the exact Pod spec revision before you change the manifest.

Scope the blast radius next. One Pod failing after a manifest change points at the spec. Many unrelated Pods failing on one node point at the runtime, node filesystem, device plugin, or kernel security policy. Many Pods failing across nodes after a platform rollout point at runtime configuration, node image, or admission defaults. That scope check decides whether you edit YAML, cordon a node, or stop a platform change.


2. How Kubernetes CreateContainerError happens in the kubelet-to-runc chain

Kubernetes CreateContainerError happens when kubelet has a Pod sandbox and container config, calls the runtime to create the container, and the runtime or OCI layer cannot build the execution environment. The failure is mechanical: namespaces, cgroups, mounts, devices, root filesystem, or security labels could not be applied.

The chain matters because each layer owns different evidence. The scheduler only placed the Pod. Kubelet pulled the image, prepared volumes, resolved environment data, and built a container configuration. The CRI runtime, usually containerd or CRI-O, received a create request. The runtime created a shim or task and called runc or an equivalent OCI runtime. Runc then set up the root filesystem, mount namespace, network namespace reference, PID and IPC namespaces, cgroup placement, device nodes, capabilities, seccomp profile, AppArmor or SELinux labels, and the process specification.

A failure in that construction returns an error before the container process exists. Kubelet records the container as Waiting with reason CreateContainerError and keeps retrying on its sync loop. Restart count stays at zero because nothing ran. That zero is a useful signal: if restarts climb, the process started at least once and you are in a different failure class.

The container internals guide explains the namespace and cgroup mechanics under this chain. For triage, the practical point is narrower: when create fails, ask which construction step failed. The event tail usually names it. If it does not, runtime logs on the node are the next source, not application telemetry.


3. CreateContainerError vs CreateContainerConfigError, RunContainerError and CrashLoopBackOff

CreateContainerError means the runtime tried to create the container and failed during construction. CreateContainerConfigError means kubelet could not build the container config. RunContainerError means creation succeeded but starting the process failed. CrashLoopBackOff means the process ran, exited, and kubelet is backing off restarts.

Status Stage that failed Typical evidence First fix area
CreateContainerError Runtime/OCI create OCI runtime create failed, mount, cgroup, device, policy tails Event tail, node runtime logs, mount and security spec
CreateContainerConfigError Kubelet config assembly secret not found, couldn't find key, runAsNonRoot image user conflict ConfigMap, Secret, env references, image user
RunContainerError Container start after create exec: ... permission denied, executable file not found, start timeout Command, entrypoint, file mode, architecture, runtime start logs
ImagePullBackOff Image pull ErrImagePull, registry auth, manifest, rate limit events Registry, pull secret, tag, digest, node network
CrashLoopBackOff Process execution Exit code, terminated reason, application logs, probe failures Application, config values, probes, resources, dependencies

The boundary between CreateContainerError and RunContainerError can blur because runtimes wrap create and start errors differently. Some entrypoint problems surface during create because runc validates the executable before reporting the container as created. Use the message, not the label alone. If the tail says the executable is missing or not executable, fix the image or command. If the tail says a mount, cgroup, namespace, device, or label operation failed, stay in runtime construction.

CreateContainerConfigError deserves special care because the names differ by one word. If kubelet cannot resolve a Secret key, ConfigMap key, downward API field, or runAsNonRoot requirement, the runtime create call may never happen. Fixing runtime configuration will not help. If the event says container create failed, failed to create containerd task, or OCI runtime create failed, the config was built far enough for the runtime to attempt construction.

The Pod lifecycle guide is useful when the phase and STATUS column disagree. For this status, phase is less important than the container waiting reason and message. The reason tells you the stage; the message tells you the mechanism.


4. Kubernetes CreateContainerError from mount and subPath failures

Mount failures are a leading Kubernetes CreateContainerError cause because the runtime builds the container mount namespace during creation. A missing hostPath, wrong subPath, file-versus-directory mismatch, duplicate mountPath, or failed volume preparation can stop creation before the process starts, even when the image pulled successfully.

Check the event path against the Pod spec. hostPath with type: Directory or type: File fails when the node path does not exist or has the wrong type. subPath fails when the referenced file or directory is absent inside the volume, or when a file is mounted onto a directory path. A ConfigMap or Secret volume can also fail at create time when the mount destination conflicts with an existing file in the image or another mount uses the same destination.

yaml
apiVersion: v1
kind: Pod
metadata:
  name: config-check
spec:
  containers:
    - name: app
      image: registry.example.com/app:1.4.2
      volumeMounts:
        - name: app-config
          mountPath: /etc/app/config.yaml
          subPath: config.yaml
          readOnly: true
  volumes:
    - name: app-config
      configMap:
        name: app-config
        items:
          - key: config.yaml
            path: config.yaml

The fix is to make the mount contract explicit. Confirm the ConfigMap or Secret key exists in the Pod namespace, confirm the subPath names that key or path, and confirm the destination type matches the image layout. For hostPath, prefer DirectoryOrCreate only when creating the directory is safe and intended; silently creating a path can hide a node provisioning failure. For node-local data, check the path on the assigned node, not on your workstation and not on another worker.

Volume preparation failures can also present as create errors when the runtime receives a mount source that kubelet prepared incorrectly or the CSI node plugin left a stale mount. Read kubelet events for FailedMount and FailedAttachVolume beside the create failure. If the volume never attached or mounted into the Pod directory, fix storage first. If kubelet prepared the volume but runc cannot bind it into the root filesystem, inspect the destination path, propagation mode, read-only flags, and SELinux relabelling cost on large volumes.


5. Kubernetes CreateContainerError from cgroup and namespace setup failures

Cgroup and namespace failures produce Kubernetes CreateContainerError when runc cannot place the container process into the required control groups or create its isolated namespaces. Messages mention cgroup configuration, memory.max, cpu.max, cpuset, namespace creation, or invalid argument. These faults often affect several Pods on one node.

Cgroup errors usually come from driver mismatch, missing controllers, read-only cgroup mounts, nested container environments without delegation, or resource values the kernel rejects. Kubelet and the runtime must agree on the cgroup driver, normally systemd on systemd nodes. A mismatch can make every new container fail while older containers keep running, which creates the confusing pattern where the node looks healthy until a rollout lands.

Check the node before editing the workload:

bash
kubectl get pods -A -o wide --field-selector spec.nodeName=<node>
kubectl debug node/<node> -it --image=ubuntu -- bash
# on the node shell:
stat -fc %T /sys/fs/cgroup/
mount | grep cgroup
journalctl -u kubelet -u containerd --since "20 minutes ago" | tail -100
crictl info | head -80

Namespace failures are lower-level and rarer on managed nodes. They appear when the runtime cannot create PID, network, mount, IPC, UTS, or user namespaces, often because of kernel restrictions, exhausted PID space, broken runtime configuration, or a node image change. hostPID, hostNetwork, and hostIPC change which namespaces are created, so a Pod that sets those fields can fail differently from a normal Pod on the same node.

Resource requests can contribute when they translate into cgroup writes the node cannot honour. Hugepages, CPU pinning, memory limits, and device cgroup rules need node support. If only Pods with a new resource field fail, remove that field in a test Pod and compare. If every Pod fails, cordon the node and treat it as a runtime or node-image incident. Restarting the runtime is a last resort after evidence capture, because it can disrupt running containers and erase the state you need.


6. Kubernetes CreateContainerError from device plugin and host resource allocation

Device allocation failures cause Kubernetes CreateContainerError when the Pod requests a device or host resource that the runtime cannot attach during creation. GPUs, specialised accelerators, host devices, and some hugepage configurations depend on device plugins and node state that the scheduler alone cannot guarantee at create time.

The scheduler allocates extended resources, but the runtime still has to expose device nodes, set device cgroup rules, mount driver libraries, and apply the correct permissions. If the device plugin Pod is down, the device is unhealthy, the driver version mismatches the runtime hook, or the allocated device disappeared after a node event, creation can fail even though the Pod was scheduled.

Inspect both the Pod and the node device state:

bash
kubectl describe pod <pod> -n <namespace>
kubectl get pods -A -o wide | grep -i "device\|gpu\|nvidia"
kubectl describe node <node> | sed -n '/Allocatable:/,/System Info:/p'
kubectl get pod <pod> -n <namespace> -o jsonpath='{.spec.containers[*].resources}{"\n"}'

Fix the layer that owns the device. Restart or repair the device plugin DaemonSet if it is not advertising healthy devices. Remove stale allocations by deleting the failed Pod only after capturing events, then let the controller recreate it. Check whether the node still advertises the resource in status.allocatable; a Pod can be scheduled against capacity that later becomes unhealthy. For host devices mounted through hostPath or privileged containers, confirm the device node exists on that node and the security context allows access.

Do not solve device create failures by making the container privileged as a reflex. Privilege can mask a missing device rule while widening the blast radius. Use the device plugin contract, the runtime hook logs, and the node allocatable state to prove which device was allocated and why the runtime could not expose it.


7. Kubernetes CreateContainerError from seccomp, AppArmor and SELinux denials

Security policy denials cause Kubernetes CreateContainerError when the runtime cannot apply the requested seccomp profile, AppArmor profile, SELinux label, capability set, or user namespace mapping. The event often ends in permission denied, operation not permitted, or a profile load failure rather than an application error.

Seccomp failures happen when a Localhost profile file is missing on the node, the profile JSON is invalid, or the runtime cannot load the profile for the container. AppArmor failures happen when the named profile is not loaded on the node or the profile denies a mount or exec operation during setup. SELinux failures happen when labels prevent the runtime from mounting volumes, executing the entrypoint, or relabelling files within the create timeout.

yaml
apiVersion: v1
kind: Pod
metadata:
  name: policy-check
spec:
  securityContext:
    seccompProfile:
      type: RuntimeDefault
  containers:
    - name: app
      image: registry.example.com/app:1.4.2
      securityContext:
        allowPrivilegeEscalation: false
        capabilities:
          drop: ["ALL"]

Start by proving whether policy is involved. Compare a minimal Pod with RuntimeDefault seccomp and no custom AppArmor or SELinux options on the same node. If the minimal Pod creates, reintroduce one setting at a time. Check node audit logs for AppArmor or SELinux denials at the create timestamp. For SELinux volume relabelling timeouts, look for very large volumes with many files; the create call can time out while labels are applied, then kubelet retries against a half-prepared container name.

The securityContext and Pod Security Standards guide covers the policy fields in depth. For create failures, keep the fix narrow: load the missing profile, correct the label, or change the volume option. Dropping all policy to make the Pod start proves the layer but leaves production weaker than the incident required.


8. Kubernetes CreateContainerError from invalid runtime spec and image config

Invalid runtime specification causes Kubernetes CreateContainerError when the OCI spec built from the Pod and image cannot be executed by the runtime. Missing commands, wrong executable paths, architecture mismatch, unsupported runtime class settings, and impossible user or working directory values can all fail before the application process runs.

Image config matters because kubelet merges the Pod spec with image metadata. If the image has no entrypoint or command and the Pod sets neither command nor args, the runtime has nothing to execute. If command points to /bin/bash in a distroless or Alpine image without bash, create or start fails with an executable lookup error. If the image was built for another architecture, the kernel returns an exec format error.

Check the image contract directly:

bash
kubectl get pod <pod> -n <namespace> -o jsonpath='{.spec.containers[*].command}{"\n"}{.spec.containers[*].args}{"\n"}'
kubectl get pod <pod> -n <namespace> -o jsonpath='{.spec.containers[*].image}{"\n"}'
crictl images | grep <image-name>
crictl inspecti <image-id>

RuntimeClass problems belong in this group. A Pod that selects a RuntimeClass whose handler is missing on the node, or whose overhead and scheduling assumptions do not match the node, can fail before normal container creation. The event may name the handler or sandbox creation rather than the app container. Confirm the node advertises the handler and that the RuntimeClass is intended for that node pool.

Working directory and user settings can also break creation when the runtime validates them against the root filesystem. A workingDir that does not exist in the image, a user that cannot be resolved when the runtime requires a passwd entry, or a read-only root filesystem combined with required writable paths can stop setup. Fix the image or spec so the contract is explicit: set a real command, use the correct architecture, create required directories in the image, and mount writable volumes where the process must write.


9. Kubernetes CreateContainerError troubleshooting matrix

Use this Kubernetes CreateContainerError matrix after reading the Failed event tail. Match the final clause to the owning layer, run the first check, and apply the fix that changes that layer. Avoid restarting the runtime or deleting the Pod until the tail and scope are known.

Event tail Likely layer First check Fix
error mounting ... no such file or directory Mount or volume prep Compare event path with volumeMounts, subPath, hostPath Correct path, key, type, or node directory
mount destination not allowed Mount namespace Check duplicate mountPath and image file layout Change destination or remove conflicting mount
applying cgroup configuration cgroup setup Check driver agreement and node cgroup mount Align systemd/cgroupfs settings, repair node
failed to write ... memory.max: invalid argument cgroup v2 limits Check requests, limits, hugepages, controller support Correct resources or node capability
error reserving ctr name Runtime retry state Check create timeout, volume relabelling, runtime load Fix slow create cause, then recreate Pod
context deadline exceeded Runtime or kubelet timeout Check node load, disk latency, SELinux relabelling, runtime logs Reduce create cost or repair node/runtime
permission denied Security or file mode Check entrypoint mode, capabilities, AppArmor/SELinux audit Fix mode, label, profile, or capability
executable file not found in $PATH Image or command spec Inspect image entrypoint and Pod command Use existing binary path or rebuild image
exec format error Architecture Compare image architecture with node architecture Publish multi-arch image or schedule correctly
failed to create containerd task Runtime wrapper Read final clause after the wrapper Fix the named mount, cgroup, device, or exec cause

The matrix is a routing tool, not a substitute for the event. Two Pods can share the same status and need opposite fixes. A missing subPath file is a manifest fix. A cgroup driver mismatch is a node fix. A device plugin outage is a platform fix. The tail and scope tell you which team should act.

When the tail is generic, widen evidence in order: Pod events, container status message, kubelet journal, runtime journal, crictl ps -a, crictl inspect, node conditions, and recent node changes. Keep timestamps aligned. Create failures often repeat every sync loop, so the first failure time matters more than the latest retry.


10. Fix Kubernetes CreateContainerError with safe node and manifest changes

Fix Kubernetes CreateContainerError by changing the layer named in the event tail, then prove creation with one replacement Pod before rolling the change wider. Manifest fixes suit mount, command, resource, and policy errors. Node fixes suit cgroup, runtime, device, and filesystem errors affecting multiple Pods.

For manifest fixes, make one change at a time. Correct the subPath or mount destination, set an executable command that exists in the image, align architecture, remove unsupported resource fields, or replace a missing localhost seccomp profile with RuntimeDefault while the profile is distributed. Apply the change to a single replica or a test Pod in the same namespace and node pool. Confirm the container reaches Running and passes readiness before continuing the rollout.

For node fixes, cordon first when several Pods fail. Capture kubelet and runtime logs, check disk and inode pressure under kubelet and runtime directories, verify cgroup driver agreement, and inspect device plugin health. Restart kubelet or the runtime only with a maintenance decision, because those restarts can affect running containers and static Pods. After the fix, uncordon and schedule a canary Pod that exercises the same mount, device, or policy path.

bash
kubectl cordon <node>
kubectl get pods -A -o wide --field-selector spec.nodeName=<node>
kubectl debug node/<node> -it --image=ubuntu -- bash
# after repair and canary success:
kubectl uncordon <node>

Use the kubectl master guide for the command patterns around events, jsonpath, and node debugging. The operational rule is simple: evidence first, smallest change second, canary third, rollout last. Deleting Pods repeatedly without changing the cause only creates cleaner-looking failure history.


11. When Kubernetes CreateContainerError is a node problem, not a Pod problem

Kubernetes CreateContainerError is a node problem when unrelated Pods fail on the same node, the event tails mention runtime timeouts or cgroup operations, or creation worked before a node image, runtime, kernel, or device plugin change. In that pattern, editing each workload delays recovery and hides the shared fault.

Prove node scope with three checks. List failing Pods by node. Compare a minimal Pod on the suspect node with the same Pod on a healthy node. Read runtime and kubelet logs for the first failure window. If the minimal Pod fails only on the suspect node, the workload spec is not the primary cause. If the minimal Pod succeeds, reintroduce the failing Pod features one at a time: mounts, devices, security context, RuntimeClass, host namespaces, and resource fields.

Node-level causes include full runtime storage, corrupted container metadata, cgroup driver mismatch, missing seccomp profiles, unloaded AppArmor profiles, SELinux relabelling timeouts, device plugin failure, kernel restrictions after an upgrade, and overloaded I/O that makes create calls exceed deadlines. Some causes leave the node Ready because kubelet heartbeats continue while creation is impaired. Ready means the node reports in; it does not prove every create path is healthy.

Treat the node as a production system under repair. Cordon it, drain only when the workload impact is understood, preserve logs, and change one node variable at a time. Managed node pools should be repaired through the provider's node replacement or upgrade path when the runtime state is corrupted. Self-managed nodes need the same discipline: fix the image or configuration in the provisioning path, not only on the one machine that failed.


12. Prevent Kubernetes CreateContainerError in production platforms

Prevent Kubernetes CreateContainerError by testing the create path, not only the running process. Validate mounts, commands, architecture, devices, security profiles, and RuntimeClass handlers in CI and node canaries. Most create failures are contract mismatches that a small pre-production Pod would expose before a rollout.

Platform teams should keep four guardrails. First, admission checks should reject duplicate mount paths, missing command contracts for scratch images, unsupported RuntimeClass use on wrong node pools, and localhost seccomp profiles that are not distributed to nodes. Second, node images should be tested with canary Pods that mount ConfigMaps, Secrets, hostPaths where allowed, devices, and restricted security contexts. Third, runtime upgrades should roll through a small node pool with create-latency and create-failure alerts. Fourth, dashboards should separate create failures from crash loops so on-call does not chase application logs for containers that never ran.

Workload teams should keep image contracts explicit. Publish multi-architecture images or pin workloads to matching node pools. Set commands that exist in the image. Avoid subPath unless the file contract is stable. Treat hostPath and privileged device access as platform-reviewed exceptions. When a release changes mounts, security context, resources, or RuntimeClass, test one Pod on a representative node before scaling.

Final checklist:

  • Read the Failed event tail before changing the manifest.
  • Confirm whether one Pod, one node, or many nodes are affected.
  • Separate config assembly, image pull, runtime create, start, and crash stages.
  • Match the tail to mount, cgroup/namespace, device, policy, or spec ownership.
  • Capture node name, image digest, event message, and first failure time.
  • Fix one layer, prove with a canary Pod, then roll wider.
  • Cordon the node when unrelated Pods fail there.
  • Add a canary or admission check for the contract that failed.

Frequently Asked Questions

What does Kubernetes CreateContainerError mean?

Kubernetes CreateContainerError means the container runtime failed to create the container after kubelet attempted creation. The Pod is scheduled and the image may already be pulled, but the process never ran. Read the Failed event tail to find whether the cause is a mount, cgroup, device, policy, or runtime spec failure.

How do I fix Kubernetes CreateContainerError quickly?

Start with kubectl describe pod and fix the final clause in the Failed event. Correct the named mount path, command, resource, device, or security setting, then prove the fix with one replacement Pod. If unrelated Pods fail on the same node, cordon the node and repair the runtime or node configuration.

Is Kubernetes CreateContainerError different from CreateContainerConfigError?

Yes. Kubernetes CreateContainerError means the runtime attempted container creation and failed during construction. CreateContainerConfigError means kubelet could not build the container config, often because a Secret, ConfigMap, key, or user requirement could not be resolved. The event text separates them: config errors name missing objects; create errors name runtime operations.

Why does Kubernetes CreateContainerError show zero restarts?

Kubernetes CreateContainerError shows zero restarts because the container process never started. Kubelet retries creation, but there is no terminated container to count as a restart. If restart count climbs, the process ran and exited, so investigate CrashLoopBackOff, probes, exit codes, and application logs instead.

Can a volume mount cause Kubernetes CreateContainerError?

Yes. A volume mount can cause Kubernetes CreateContainerError when the runtime cannot build the mount namespace. Common causes are a missing hostPath, a wrong subPath, a file mounted onto a directory path, duplicate mount destinations, or a volume source that was not prepared correctly on the node.

Should I restart containerd for Kubernetes CreateContainerError?

Restart containerd only after evidence shows a node runtime fault and the node is cordoned or in maintenance. Kubernetes CreateContainerError is often a manifest, mount, device, or policy issue that a restart will not fix. Capture kubelet and runtime logs first, then restart as a controlled node repair step.

How can I prevent Kubernetes CreateContainerError in production?

Prevent Kubernetes CreateContainerError by testing create contracts before rollout: mounts, subPath files, commands, image architecture, devices, seccomp profiles, RuntimeClass handlers, and restricted security contexts. Add node canaries after runtime upgrades and alert on create failures separately from crash loops so teams fix the correct layer quickly.

⚡ KUBERNETES SCENARIO INTERVIEW PREP

Preparing for Senior Platform & SRE Interviews

Practice real-world cluster triage, RBAC debugging, and pod scheduling scenarios in our Kubernetes scenario interview questions hub.

Explore Interview Scenarios →