How to Fix Kubernetes CrashLoopBackOff: Step-by-Step Guide
kubectl logs --previous pod-name to retrieve logs from the last crashed container instance before Kubernetes restarted it. CrashLoopBackOff is a Kubernetes state indicating that a container repeatedly fails to start and Kubernetes is delaying restart attempts using an exponential backoff strategy. According to Komodor State of Kubernetes 2024 data, this error represents 23 percent of production incidents. As a developer, understanding why the container exits immediately is the fastest path to resolving the underlying failure.
What does CrashLoopBackOff mean in Kubernetes?
CrashLoopBackOff means a container within a pod has started, crashed, and restarted multiple times while Kubernetes applies an exponential backoff delay to prevent resource exhaustion. The backoff delay starts at 10 seconds, doubles with each subsequent failure, and caps at five minutes or 300 seconds. The timer resets if the container runs successfully for 10 consecutive minutes without crashing.
How to troubleshoot and fix a CrashLoopBackOff error
To fix a CrashLoopBackOff error, you must diagnose the specific exit code and application logs causing the failure. We recommend following these sequential steps to isolate and resolve the issue.

- Run
kubectl get podsto identify the pod stuck in the CrashLoopBackOff state and note its restart count. - Run
kubectl logs <pod-name> --previousto read the standard output and standard error from the crashed instance. You should see application stack traces, missing environment variables, or panic messages explaining why the process terminated. - Run
kubectl describe pod <pod-name>to check the pod’s termination state and exit codes. Look for exit code 137, which signals SIGKILL and may indicate an out-of-memory error, or exit code 143, which signals a SIGTERM typically triggered when liveness probes time out. [cast.ai] - Inspect your deployment configuration files to verify that environment variables, ConfigMaps, secrets, and volume mounts are correctly defined.
- Apply your corrected configuration using
kubectl apply -f deployment.yamland verify that the pod status changes to Running.
What are the common causes of container crashes?
| Symptom or Exit Code | Root Cause | Recommended Fix |
|---|---|---|
| Exit Code 137 (OOMKilled) | Resource limits set too low for memory consumption | Increase memory limits in the container resource specification |
| Exit Code 143 (SIGTERM) | Liveness or startup probe timing out before application initialization | Increase initialDelaySeconds or failureThreshold in probe configurations |
| Missing ConfigMap or Secret | Application fails to start because required environment variables are absent | Create the missing ConfigMap or Secret and redeploy the pod |
| Application Panic | Software bug, unhandled exception, or bad database connection string | Fix the application code or update connection parameters |
Each of these causes requires a targeted adjustment to your manifests or code. If your container runs out of memory, simply restarting the pod without raising its memory limit will only trigger another OOMKilled event.

How to confirm the pod is fixed
You confirm the crash loop is resolved by running kubectl get pods -w and watching the pod transition from CrashLoopBackOff to a stable Running state with a restart count that stops incrementing. Additionally, run kubectl logs <pod-name> to ensure your application is actively processing traffic or requests without throwing startup errors.

Related guides
Frequently asked questions
What is the difference between CrashLoopBackOff and ImagePullBackOff?
ImagePullBackOff means Kubernetes cannot download the container image due to an invalid image name, authentication failure, or network timeout. CrashLoopBackOff means the image pulled and unpacked successfully, but the container process itself started and then crashed.
Are liveness probes the only cause of CrashLoopBackOff?
No, liveness probes are a frequent culprit when they time out and kill healthy applications, but CrashLoopBackOff occurs whenever any container is repeatedly restarted after exiting, including after a zero status code when its restart policy requires it. [docs.cloud.google.com]
How do I force restart a crashing pod?
You can force restart a pod by deleting it using kubectl delete pod <pod-name>, which prompts your Deployment or ReplicaSet controller to create a fresh pod immediately. However, if you do not fix the root cause, the new pod will also enter a CrashLoopBackOff state.