Kubernetes: CrashLoopBackOff
The container starts, crashes (or exits), and Kubernetes keeps restarting it with increasing back-off delays.
Meaning
CrashLoopBackOff is a symptom, not a cause. The real error is in the previous container’s logs or in the pod’s events/last state (exit code, OOMKilled, failed probes).
Common causes
- Application error on startup (missing env var, config, secret)
- Container command exits immediately (no long-running process)
- Liveness probe failing and killing the container
- OOMKilled due to low memory limit
- Can’t reach a dependency (DB) and exits
- Wrong image/entrypoint for the architecture
⚡ Quick fix
kubectl logs <pod> --previousto see why it crashedkubectl describe pod <pod>→ Last State, Exit Code, Events- Check env vars, ConfigMaps and Secrets are mounted
- Relax/repair liveness probes (initialDelaySeconds)
Detailed fix by platform
Kubernetes
- Investigation commands:bash
kubectl get pods kubectl describe pod api-7d9f8b6c5-x2kqp kubectl logs api-7d9f8b6c5-x2kqp --previous kubectl get events --sort-by=.lastTimestamp | tail -20 - Exit code 137 = killed (often OOM), 1 = app error, 127 = command not found, 126 = not executable.
How to diagnose
- Previous logs — What did the app print before dying?
- Exit code — From describe → Last State
- Probes — Liveness killing it?
- Resources — OOMKilled?
- Config — Env/secrets present?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026