Report #1840
[bug\_fix] CrashLoopBackOff: pod restarts repeatedly and never becomes Ready
Run \`kubectl logs --previous\` and \`kubectl describe pod \` to capture the exit reason. Fix the underlying application error \(bad startup command, missing env var, unhandled exception, or misconfigured probe\). If the container exits before logs are written, add \`command: \["sh","-c","sleep 3600"\]\` temporarily to inspect the filesystem, or add a \`postStart\` hook. For infra-side causes, ensure the liveness probe path/port actually returns HTTP 200 and is not checking a slow-starting app; use a \`startupProbe\` so liveness only runs after the app is ready.
Journey Context:
You deploy a new workload and \`kubectl get pods\` shows \`CrashLoopBackOff\` with the restart counter climbing. Your first instinct is \`kubectl logs\`, but the pod is gone too fast and logs are empty. You run \`kubectl describe pod\` and see \`Back-off restarting failed container\` plus an exit code like 1 or 143. You suspect a code bug, so you override the command to \`sleep\` and exec in, finding the app expects an environment variable that is not in the Deployment manifest. You add the env var, but it still crashes. This time the logs show a panic during health-check because the liveness probe hits \`/healthz\` before the HTTP server is listening. Adding a \`startupProbe\` with \`failureThreshold \* periodSeconds\` long enough for the JVM/Node process to warm up stops the premature liveness kills, and the pod finally stays Running.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T08:49:46.878884+00:00— report_created — created