What does CrashLoopBackOff mean, and how do you fix it?

CrashLoopBackOff is a Kubernetes Pod status that means a container keeps exiting and the kubelet is waiting before it restarts it again. The wait starts at 10 seconds, doubles after each crash and is capped at 5 minutes. CrashLoopBackOff is a symptom, not the error itself: the cause is whatever makes the container’s process exit, and you find it in the previous container’s logs, its exit code and the Pod’s events.

What the status means

When a container in a Pod exits and the Pod’s restartPolicy is Always or OnFailure, the kubelet restarts it on the same node. If it exits again, the kubelet waits before the next attempt. During that wait the container is in the Waiting state with the reason CrashLoopBackOff, which kubectl get pods shows in the STATUS column:

text
NAME                   READY   STATUS             RESTARTS      AGE
api-7d9c8b6f5d-x2kqp   0/1     CrashLoopBackOff   6 (2m ago)    9m

The Pod’s events show the matching warning that people often search for:

text
Warning  BackOff  kubelet  Back-off restarting failed container api in pod api-7d9c8b6f5d-x2kqp

The Pod is not moved to another node and not recreated. The same container restarts in place, and the RESTARTS count grows.

How the back-off timing works

According to the Pod lifecycle documentation, the kubelet restarts exited containers “with an exponential backoff delay (10s, 20s, 40s, …), that is capped at 300 seconds (5 minutes)”. Once a container has run for 10 minutes without problems, the timer resets.

RestartDelay before it
110 s
220 s
340 s
480 s
5160 s
6 and later300 s

Two newer settings change this. With the KubeletCrashLoopBackOffMax feature, beta and enabled by default since Kubernetes 1.35, administrators can lower the cap per node with crashLoopBackOff.maxContainerRestartPeriod in the kubelet configuration, to any value from 1 to 300 seconds. The ReduceDefaultCrashLoopBackOffDecay feature, alpha since 1.33 and off by default, starts at 1 second and caps at 60 seconds.

How to find the cause

  1. Describe the Pod and read the last termination of the failing container:

    bash
    kubectl describe pod <pod>

    Look at Last State: Terminated, its Reason and Exit Code, and the Events at the bottom.

  2. Read the logs of the crashed container, not the one currently waiting:

    bash
    kubectl logs <pod> -c <container> --previous
  3. List the events for the Pod if describe truncates them:

    bash
    kubectl get events --field-selector involvedObject.name=<pod>
  4. If the container exits before it writes anything, start a copy of the Pod with a shell instead of the normal command and run the entrypoint by hand. The debugging documentation shows the pattern:

    bash
    kubectl debug <pod> -it --copy-to=<pod>-debug --container=<container> -- sh

What the exit code tells you

Exit codes above 128 mean the process was killed by a signal: the code is 128 plus the signal number.

Exit codeMeaningWhere to look
0The process finished successfully, but restartPolicy: Always restarts itThe workload is a one-off task; run it as a Job
1Generic application errorApplication logs
126Command found but not executableFile permissions, image entrypoint
127Command not foundcommand and args in the Pod spec, image contents
137Killed with SIGKILL (9), often by the out-of-memory killerExit code 137 and OOMKilled
139Segmentation fault (SIGSEGV, 11)Native code, base image libraries
143Stopped with SIGTERM (15)Liveness probe failures, shutdowns

Common causes

  • Missing or wrong configuration. An environment variable, Secret or config file the application expects is missing or has the wrong value, and the process exits at startup. The logs usually say so.
  • A dependency is unreachable. The application cannot reach its database, message broker or the Kubernetes API at startup and exits instead of retrying. A network policy is a frequent reason; see network connectivity issues.
  • Out of memory. The container goes over its memory limit and is killed, with reason OOMKilled and exit code 137.
  • A liveness probe that fires too early. A slow-starting application fails its liveness probe and the kubelet kills it before it is ready. Add a startupProbe or raise the probe’s initial delay and failure threshold.
  • Wrong command or arguments. A typo in command or args overrides the image entrypoint with something that does not exist.
  • Wrong CPU architecture. An image built only for amd64 fails with exec format error on an arm64 node. See handle single-platform container images.
  • Permissions. A container running as non-root, or with a read-only root file system, cannot write where the application expects.
  • A task that ends. A script or migration exits with code 0, and the Deployment restarts it forever. It belongs in a Job.

CrashLoopBackOff vs similar statuses

StatusWhat it means
CrashLoopBackOffThe container started and keeps exiting
ImagePullBackOff or ErrImagePullThe image cannot be pulled, so the container never started
CreateContainerConfigErrorA referenced Secret or ConfigMap is missing
PendingNo node has been assigned yet; see Pods stuck in Pending
OOMKilledThe last run ended because the container exceeded its memory limit

Fixing it

Fix the cause and roll out a corrected version: new configuration, a fixed image or adjusted probes and limits. Deleting the Pod only creates a new one with the same problem. Once the new container runs for 10 minutes, the back-off timer resets and the restart count stops growing.

On this page