Report #1164
[bug\_fix] CrashLoopBackOff
Inspect the previous container logs with \`kubectl logs --previous\` to find the exit reason, then patch the cause \(e.g., fix the command/entrypoint, supply a missing env var or config file, or raise the memory limit if the process is being OOM-killed\). If logs are empty, run \`kubectl describe pod \` to see the Last State and Events, and use \`kubectl debug\` or an ephemeral container to inspect the filesystem.
Journey Context:
A Deployment rolls out and pods immediately flip between Running and CrashLoopBackOff. \`kubectl get pods\` shows restart counts climbing. \`kubectl logs\` returns nothing because the current container just started; adding \`--previous\` reveals the real stack trace — in this case a Python app failing on \`ModuleNotFoundError\` because the requirements.txt was not rebuilt into the image. The developer realizes the CI cache layer reused an old image layer. After rebuilding with \`--no-cache\` and redeploying, the pods stay Running. The key insight is that CrashLoopBackOff is a symptom, not a root cause; the actual error is almost always in the previous container's logs or in the pod events.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T18:55:10.420496+00:00— report_created — created