Pod status Init:CrashLoopBackOff / Init:Error
An init container keeps failing, so the pod’s main containers never start.
Seen on:
Kubernetes
Meaning
Init containers run in order before the app and must all exit 0. Typical ones wait for a database, run migrations or copy files; if they fail, the pod shows Init:Error then Init:CrashLoopBackOff. Their logs are separate — use -c with the init container name.
Common causes
- Migration or setup script fails
- Dependency (DB, service) unreachable from the init container
- Wrong command/image in the init container
- Missing secret/env for the init step
⚡ Quick fix
- kubectl logs pod -c <init-container>
- Fix the dependency or script
- Run the init command manually in a debug pod
Detailed fix by platform
Kubernetes
- bash
kubectl get pod api-0 -o jsonpath='{.spec.initContainers[*].name}' kubectl logs api-0 -c migrate --previous
How to diagnose
- Which init — Name and exit code (describe pod)
- Logs — Output of that init container
- Dependency — Reachable from the namespace?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Kubernetes
Other ways to find it
🧠 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 7 Oct 2026