Working a CrashLoopBackOff: the first five minutes

A CrashLoopBackOff is a symptom, not a cause. The order to read things in, why kubectl logs usually shows you the wrong container, and what the exit code narrows it to.

How do I work a CrashLoopBackOff, step by step?

Read the previous container's logs first, because the running container has not failed yet. Then take the exit code from the last state, which tells you whether the process chose to stop or was killed. The restart count and the time between restarts tell you how long this has been going on.

Start with the run that failed, not the one that is waiting

The container you can reach with kubectl logs is the one about to start. The one that crashed is already gone, and its output is the only place the cause is written down. This is the single most common reason an engineer says there is nothing in the logs.

kubectl logs <pod> -n <namespace> --previous
kubectl logs <pod> -n <namespace> -c <container> --previous

If the previous container produced nothing at all, that is information too: the process died before it could write, which points at the image, the entrypoint or a missing mount rather than at the application.

Take the exit code before you form a theory

The last state on the pod carries the exit code and a reason, and the two together rule out most of the field.

kubectl get pod <pod> -n <namespace> \
  -o jsonpath='{.status.containerStatuses[*].lastState.terminated}'
  • Exit 1 or another small non-zero code: the process started and stopped itself. Configuration, a missing environment variable, or a dependency it could not reach.
  • Exit 137 with reason OOMKilled: it went over its memory limit. That is a different investigation, and OOMKilled is the page for it.
  • Exit 137 with no OOMKilled reason: something sent SIGKILL. Often a liveness probe killing a container that was too slow to answer.
  • Exit 143: SIGTERM. Usually a rollout or a drain, which means the restart may be normal and the real problem is elsewhere.

Read the restart count as a clock

The back-off doubles each time up to five minutes. A pod with four restarts has been failing for under a minute. One with thirty has been failing for hours, which changes who needs to know. The count also separates a crash loop from a pod that restarted once during a deploy and settled.

The three causes that cover most of them

The application cannot reach something it needs at boot

A database, a secret store, a queue. The previous logs usually say so in the application's own words, and the fix is rarely in the manifest.

The configuration changed and the process refuses to start

A renamed environment variable, a bad config file, a flag that no longer exists. Compare the failing pod's spec with the last one that ran rather than with what you expect it to be.

The probe is killing it before it is ready

A liveness probe with no startup probe in front of it restarts a container that simply needs longer to boot. If the restarts are regular to the second, suspect the probe before the process. Probes that kill healthy pods is the walkthrough for that case.

What KubeGraf does with this one

KubeGraf watches for CrashLoopBackOff and pulls the previous container's logs, the exit code, the recent deploys and the events into one place, with the evidence attached to each candidate cause. It prepares a change through the agents, and nothing is applied to your cluster until a person or a policy you set approves it.

The reference

For the full list of causes, every command and the fixes with their trade-offs, use the reference page: CrashLoopBackOff.

Sources

Read on 25 November 2026. Check the source before you rely on a detail.

Frequently asked questions

Why do kubectl logs show nothing useful for a CrashLoopBackOff?

You are reading the container that is waiting to start, not the one that failed. Add the previous flag to read the run that actually crashed.

What does exit code 1 mean in a CrashLoopBackOff?

The process started and then stopped itself with an error. That points at configuration or a failed dependency rather than at Kubernetes.

Is a pod that keeps restarting always CrashLoopBackOff?

No. CrashLoopBackOff only means the kubelet is now waiting longer between attempts. A pod can restart repeatedly without ever reaching that state.

How long should I wait before escalating?

The back-off doubles up to five minutes, so a pod left alone gets slower to retry rather than better. If the previous logs and the exit code do not explain it in a few minutes, bring in whoever owns the workload.

Want this worked for you on your own clusters? Apply for KubeGraf Freemium. Three calendar months by approval, no card and no automatic paid conversion.

Last updated . Try KubeGraf Freemium.