CrashLoopBackOff: read the exit code before you touch the YAML
verbatim errorBack-off restarting failed container
pod/app-7d9c6b5f4-xqz2l: CrashLoopBackOff
container "app" in pod "app-7d9c6b5f4-xqz2l" is waiting to start: CrashLoopBackOff
Problem
Back-off restarting failed container
pod/app-7d9c6b5f4-xqz2l: CrashLoopBackOffThe reflex is to re-read the deployment YAML for ten minutes, then kubectl delete pod and hope. The pod came back, crashed again, back-off stretched to 5 minutes, and the on-call lost an hour.
Root cause
CrashLoopBackOff is not an error, it is a state: the container starts and exits non-zero, repeatedly. Six causes cover nearly every case, and the exit code tells you which:
- 1: the app itself failed — bad config, missing env var, unhandled exception
- 137 (SIGKILL): OOMKilled or a liveness probe kill; check
RESTARTSandkubectl describe - 126/127: command not executable / not found — image vs command mismatch
- 0 with restarts: the process ran and exited cleanly — usually a foreground flag missing (a server started in background mode)
There is a diagnostic order that finds the cause in under two minutes.
fix preview — first 3 of 6 lines (bash), truncated:
kubectl describe pod app-7d9c6b5f4-xqz2l | grep -A8 "Last State"
# Last State: Terminated
# Reason: Error
… 3 more lines in the fix🔒 the fix — including 3 code blocks — is members-only. $1/mo unlocks everything.