OPERATIONAL RUNBOOK · OCT 16, 2026

Kubernetes CrashLoopBackOff: Causes, Diagnosis, and Safe Fixes

A comprehensive, evidence-based engineering guide to diagnosing container restart loops, inspecting exit codes, analyzing logs, isolating failed probes, and applying safe remediation in Kubernetes.

Published: October 16, 2026•Audience: SREs, Platform Engineers, DevOps•Target: Kubernetes v1.24 - v1.32+

1. What Does CrashLoopBackOff Mean?

In Kubernetes, CrashLoopBackOff is not an error generated by your application code. Rather, it is a state reported by the Kubelet indicating that a container has repeatedly started, crashed, and that Kubernetes is applying an exponential backoff delay before trying to start it again.

When a container terminates unexpectedly with a non-zero exit code (or when a liveness probe fails), the Kubelet restarts it based on the pod's restartPolicy (default: Always). To prevent CPU thrashing and log flooding from immediate back-to-back restarts, Kubernetes delays each subsequent restart: 10s, 20s, 40s, 80s, 160s, capping at a maximum backoff delay of 300 seconds (5 minutes).

Important Diagnostic Distinction

CrashLoopBackOff is a symptom, not a root cause. You cannot fix CrashLoopBackOff directly; you must identify the underlying reason why the container exited or was terminated.

2. Common Causes vs. Confirmed Diagnoses

Operators frequently mistake common guesses for confirmed diagnoses. Here is how typical causes categorize:

Application & Runtime Failures

  • Exit Code 1 / General Error: Unhandled exceptions, missing environment variables, syntax errors, or panics.
  • Exit Code 126 / 127: Container command or entrypoint binary not found or lack execute permissions.
  • Exit Code 139: Segmentation fault (memory corruption or native library incompatibility).

Kubernetes Infrastructure & Probes

  • Exit Code 137 (OOMKilled): The container exceeded its cgroup memory limit (limits.memory).
  • Exit Code 143 (SIGTERM): Graceful shutdown requested by Kubernetes, often triggered by a failing liveness probe.
  • Missing Dependencies: Referenced ConfigMap, Secret, or PersistentVolumeClaim unattached.

3. Step-by-Step Diagnostic Workflow

Follow this systematic workflow to move from observing a crash loop to a confirmed root cause without making disruptive changes.

Step 3.1: Locate the Affected Pod and Namespace

Quickly scan all namespaces for pods trapped in a non-running state:

Identify CrashLooping pods across all namespaces
kubectl get pods -A | grep -E 'CrashLoopBackOff|Error'

Illustrative output:

payments-service-789f84b6cb-x4z9l   0/1   CrashLoopBackOff   6 (45s ago)   14m   production

Step 3.2: Inspect Termination Reason and Exit Code

Do not guess why the container died. Extract the exact exit code and termination reason recorded by the container runtime:

Extract container termination state and exit code
kubectl get pod <pod-name> -n <namespace> -o jsonpath='{range .status.containerStatuses[*]}{.name}{": ExitCode="}{.lastState.terminated.exitCode}{" Reason="}{.lastState.terminated.reason}{"\n"}{end}'

Alternatively, examine the full pod details:

Describe pod to view state transitions
kubectl describe pod <pod-name> -n <namespace>

Step 3.3: Fetch Previous Container Logs

Because the current container may currently be waiting during its backoff window or newly spun up, inspect the logs from the crashed instance:

Read logs of the previously terminated container instance
kubectl logs <pod-name> -n <namespace> --previous --tail=100
Tip: If the pod has multiple containers, specify the target container with -c <container-name>.

Step 3.4: Review Namespace Events

Kubelet and controller warnings provide critical timeline context regarding probe timeouts or OOM events:

Sort recent cluster events by timestamp
kubectl get events -n <namespace> --sort-by=.lastTimestamp

4. How to Distinguish Between Failure States

State / SymptomPrimary IndicatorUnderlying Mechanism
CrashLoopBackOffExit code recorded, restart count incrementingProcess started, but died or failed liveness probe.
OOMKilledExit Code 137, Reason: OOMKilledLinux kernel OOM-killer terminated process for exceeding memory limit.
ImagePullBackOffPod status: ImagePullBackOff / ErrImagePullContainer never started; registry 401, missing image tag, or network block.

5. Safe Remediation Steps

Once logs and exit codes reveal the specific cause, apply safe, evidence-based remediation:

Scenario A: Missing Environment Variable or Secret

If logs display KeyError: 'DB_PASSWORD' or similar, verify that the referenced Secret exists and contains the required key before patching the deployment.

Verify referenced secret exists
kubectl get secret app-secrets -n <namespace> -o jsonpath='{.data}'

Scenario B: Over-Aggressive Liveness Probe

If the app takes 45 seconds to initialize database connections but the liveness probe fires at 15 seconds, increase initialDelaySeconds or configure a startupProbe.

Example Startup Probe in Deployment Spec
startupProbe:
  httpGet:
    path: /healthz
    port: 8080
  failureThreshold: 30
  periodSeconds: 10

Scenario C: How AetherKube Automates CrashLoop Triage

AetherKube continuously correlates container exit codes, termination logs, and probe failures in real time. Rather than guessing, AetherKube pinpoints whether an incident is caused by database lockups, probe starvation, or configuration drift, with full audit trail logging and safe blast-radius boundaries.

6. Verification and Operational Prevention

After applying a configuration fix, always verify rollout health and monitor container restart stabilization:

Watch deployment rollout status
kubectl rollout status deployment/<deployment-name> -n <namespace> --timeout=120s
Confirm restart count has stabilized (remains 0)
kubectl get pods -l app=<app-label> -n <namespace> -w

Operational Prevention Best Practices:

  • Always use Startup Probes for slow runtimes: Java JVM, Rails, and heavy Node.js apps should use startup probes so liveness checks don't prematurely kill booting instances.
  • Validate Configuration Pre-Deployment: Run linting and dry-run validation (kubectl apply --dry-run=client) to catch syntax errors.
  • Handle SIGTERM Cleanly: Implement graceful shutdown listeners in your application to drain active requests before exit.

Frequently Asked Questions

Will deleting the pod fix CrashLoopBackOff?

Rarely. If the pod is managed by a Deployment or StatefulSet, Kubernetes immediately creates a replacement replica with the identical configuration, which will encounter the exact same exit condition. You must fix the underlying cause.

Where can I consult official Kubernetes debugging documentation?

Refer to the official Kubernetes documentation on Debugging Pods .

Automate Kubernetes Incident Diagnosis

Download AetherKube v1.0.0 Public Beta to detect, diagnose, and remediate CrashLoopBackOff automatically.

Get Public Beta