Kubernetes CrashLoopBackOff errors: 6 causes and fixes

Last updated: Jun 17, 2026

Kubernetes now runs production workloads for 82% of container users, according to the CNCF 2025 Annual Cloud Native Survey. As clusters grow more complex, operational failures become harder to ignore. CrashLoopBackOff is one of the most common of those failures: a pod state that tells you something is consistently broken, but not what or where. Diagnosing it quickly matters because a pod stuck in a restart loop doesn't just affect its own workload — it can cascade into service degradation, missed SLAs, and on-call escalations that eat into engineering time. This guide covers the six root causes, the exact kubectl commands to diagnose each one, and what to do to prevent recurrence.

What is Kubernetes CrashLoopBackOff?

CrashLoopBackOff is a Kubernetes state that indicates a container is repeatedly failing to start, and Kubernetes is delaying its restart attempts.

When a container exits with an error, the kubelet restarts it. If the failure continues, Kubernetes applies an exponential backoff between restarts, starting at 10 seconds and doubling with each failure, up to a maximum of five minutes. This is the "backoff" reflected in the pod status.

The important distinction is that CrashLoopBackOff is not the root cause of the issue. It's a signal. Something in your application, configuration, or runtime environment is consistently failing, and Kubernetes is preventing an aggressive restart loop.

How to diagnose CrashLoopBackOff quickly

Most CrashLoopBackOff issues can be narrowed down in minutes using two commands:

kubectl describe pod <pod-name> -n <namespace>
kubectl logs <pod-name> -c <container-name> --previous -n <namespace>

The first command surfaces Kubernetes-level events, failed mounts, probe errors, missing dependencies. The second tells you what actually caused the container to crash.

The --previous flag is critical. Without it, you're often looking at logs from a container that hasn't had time to initialize, which leads to misleading conclusions.

For namespace-level triage across multiple pods, add a third command:

kubectl get events -n <namespace> --sort-by='.lastTimestamp'

This surfaces all recent events in a namespace sorted by time, which is significantly faster than describing pods one by one when you don't yet know which workload is the source of a failure.

Quick signals to look for

Exit code / signal What it means
Exit code 0 Container exited cleanly; likely a wrong or missing entry point
Exit code 1 Generic application crash; check application logs
Exit code 137 OOMKilled; container exceeded memory limit
Exit code 139 Segmentation fault; memory access violation in the application
Exit code 143 SIGTERM timeout; container didn't shut down cleanly within the grace period
Repeated probe failures Misconfigured liveness or readiness checks
Missing resource errors Secrets or ConfigMaps not found
Consistent stack traces Application-level failure

Exit codes 0 and 143 are the most commonly misread. A clean exit (0) in a CrashLoopBackOff loop almost always means the container ran, completed, and exited — pointing to a wrong entry point or a short-lived job being run as a long-running service. Exit code 143 means Kubernetes sent SIGTERM but the container didn't respond within the termination grace period.

Why CrashLoopBackOff happens

Kubernetes is designed to maintain the desired state of your workloads. When a container fails, it assumes the failure is temporary and attempts to recover by restarting it.

The problem arises when the failure is not transient. Each restart hits the same issue — whether it's a memory limit, a missing dependency, or a startup error — and the system enters a loop. Kubernetes slows the restart attempts to reduce resource churn, but it won't resolve the underlying issue on its own.

A restart count of two or three might not be alarming. But when the count keeps increasing and the pod never stabilizes, you're dealing with a persistent failure that requires intervention.

CrashLoopBackOff vs. ImagePullBackOff

These two states are frequently confused because they look similar in kubectl get pods output — both show a pod that isn't running, and both use the backoff retry mechanism. The distinction is where the failure occurs.

ImagePullBackOff means Kubernetes cannot pull the container image — either the image name or tag is wrong, the registry is unreachable, or credentials are missing. The container never starts. CrashLoopBackOff means the image pulled successfully but the container fails after starting. If you see ErrImagePull or ImagePullBackOff in pod events, the issue is upstream of the application entirely and requires fixing the image reference or registry access, not the application configuration.

Six common CrashLoopBackOff causes and how to fix them

1. Resource limits set too low (OOMKilled)

Memory exhaustion is one of the most frequent causes of CrashLoopBackOff in production clusters.

When a container exceeds its memory limit, it is terminated by the kernel. Kubernetes records this as OOMKilled, restarts the container, and the same workload triggers the same failure again.

You'll typically see this in the pod description:

Last State: Terminated
  Reason:    OOMKilled
  Exit Code: 137

Exit code 137 indicates the container was forcibly terminated, not that it exited gracefully.

The fix is straightforward in principle but often mishandled in practice. Increasing memory limits blindly might stop the immediate crash, but it doesn't address whether the application is behaving as expected under load. The better approach is to base limits on observed usage — either from staging tests or production metrics — so you're setting boundaries informed by real behavior.

CPU constraints can indirectly contribute. Heavy throttling slows responses enough for health checks to fail, triggering restarts even when memory isn't the direct cause.

2. Misconfigured liveness or startup probes

Health checks are meant to improve resilience, but misconfigured probes are a common cause of unnecessary restarts.

If a liveness probe runs too early or times out too quickly, Kubernetes may kill a container that is still initializing or responding slowly under load.

You will usually find evidence of this in pod events:

Liveness probe failed: context deadline exceeded

This is especially common with applications that have non-trivial startup times — JVM-based services, workloads that run migrations on boot, or systems that load large datasets into memory.

The fix is to align probe configuration with real startup behavior. Increasing initialDelaySeconds and timeoutSeconds often resolves the issue, but for slower applications, introducing a startupProbe is the more reliable approach. It allows Kubernetes to wait for initialization to complete before applying liveness checks — separating "is this container starting" from "is this container healthy" as distinct questions with distinct parameters.

3. Missing or misconfigured secrets and ConfigMaps

Some failures happen before your application even begins execution. If a required secret or configuration value is missing, the container can fail during initialization, often without producing meaningful logs.

In these cases, the error shows up in pod events rather than application output:

Error: secret "db-credentials" not found

This is a common issue in multi-environment deployments where configurations exist in staging but haven't been replicated correctly in production.

The resolution involves verifying three things: that the resource exists, that it contains the expected keys, and that it's referenced correctly in the pod specification.

4. Port conflicts

If an application attempts to bind to a port that is already in use, it will fail immediately and trigger a restart.

Unlike configuration errors, this type of issue appears in container logs:

bind: address already in use

Port conflicts typically arise in scenarios involving shared network namespaces, such as hostNetwork pods, or when multiple workloads inadvertently use the same port. Resolving this requires identifying the conflicting process or reassigning ports to ensure isolation between workloads.

5. RBAC permission issues

Applications that interact with the Kubernetes API rely on service account permissions. If those permissions are insufficient, API calls fail — and depending on how the application handles those failures, it may exit immediately.

A typical error looks like this:

User "system:serviceaccount:default:my-sa" cannot list resource "pods"

This indicates that the service account lacks the necessary role bindings. The fix is to audit the associated Role or ClusterRole and ensure it includes the required permissions. You can validate access using:

kubectl auth can-i list pods --as=system:serviceaccount:<namespace>:<serviceaccount>

6. Application-level failures

When infrastructure and configuration checks don't reveal the issue, the root cause usually lies within the application itself.

These failures surface clearly in logs — exceptions, dependency connection errors, or invalid configuration handling.

One pattern that often goes unnoticed is applications waiting indefinitely on external dependencies. They don't crash immediately, but they also don't become healthy. Eventually, a liveness probe fails, and Kubernetes restarts the container, creating a loop that appears unrelated to the original issue.

The Kubernetes-native solution to dependency wait loops is init containers. An init container runs to completion before the main container starts — polling a database port, waiting for a secret, or running a schema migration. If it fails, the main container never starts, which surfaces the dependency failure clearly instead of burying it in a restart loop.

In these cases, logs from the previous container instance provide the most reliable insight into what's happening during startup.

Resetting the backoff timer after a fix

Once you've pushed a fix, you don't have to wait through the full backoff sequence for Kubernetes to retry. Deleting the pod forces an immediate fresh restart:

kubectl delete pod <pod-name> -n <namespace>

If the pod is managed by a Deployment or ReplicaSet, Kubernetes will recreate it immediately. This is particularly useful when the backoff has reached its five-minute cap and you've already confirmed the fix is in place.

How to prevent CrashLoopBackOff in production

Fixing a restart loop is reactive. Preventing it requires a more deliberate approach to configuration, testing, and observability.

Where most teams go wrong

Setting resource limits without profiling real workloads, using default probe configurations for all applications, and skipping validation of configs across environments. These shortcuts often work in early stages but fail under production conditions.

What actually works

  • Validate Kubernetes manifests in CI/CD pipelines before deployment. Tools like kubeval, kube-linter, and kube-score catch schema violations, missing secret references, and probe configuration gaps before a change reaches the cluster. kube-score in particular scores manifests against best practices including resource request and limit coverage, which kubeval alone does not check.
  • Profile applications under realistic load before setting resource limits and set both requests and limits deliberately. Requests determine where Kubernetes schedules a pod; limits determine when Kubernetes kills it. Setting limits without accurate requests means pods can be scheduled onto nodes that can't sustain them.
  • Design health checks that reflect actual startup and runtime behavior. A startupProbe with a high failureThreshold and short periodSeconds gives slow-starting applications room to initialize without triggering a restart cascade.
  • Use horizontal pod autoscaling (HPA) to absorb load spikes rather than letting individual pods hit resource ceilings. HPA scales pod count in response to CPU or memory pressure before exhaustion triggers a crash.
  • Monitor not just logs, but also metrics and system behavior over time. Logs tell you what happened. Metrics and traces tell you what was happening when it happened — and historical CPU, memory, and restart count data is significantly faster to work with during incident triage.

Cluster-wide visibility into CrashLoopBackOff

In large clusters, a pod stuck in CrashLoopBackOff in one namespace doesn't always surface until something downstream breaks. Manual checks across namespaces don't scale.

OpManager Nexus monitors Kubernetes clusters across on-premises, EKS, GKE, and AKS environments from a single console. It auto-discovers every pod, node, deployment, and namespace without manual configuration, and surfaces container restart counts and pod status transitions in real time. Threshold-based alerts let platform teams act before a climbing restart count becomes a production incident.

Key takeaways

  • CrashLoopBackOff is a symptom of repeated container failure, not the cause itself.
  • Most issues fall into six categories: resource limits, probes, configs, ports, permissions, or application errors.
  • kubectl logs --previous is essential for accurate diagnosis.
  • Exit code 137 indicates OOMKilled, pointing directly to memory constraints.
  • Prevention depends on better configuration, testing, and observability — not just faster debugging.

Frequently asked questions

What is CrashLoopBackOff in Kubernetes?

CrashLoopBackOff is a state where a container repeatedly fails and Kubernetes delays restarts using exponential backoff, starting at 10 seconds and capping at five minutes.

What does exit code 137 mean in Kubernetes?

Exit code 137 indicates the container was terminated due to an out-of-memory condition (OOMKilled). The kernel forcibly ended the process because it exceeded its memory limit.

How do I get logs from a crashed pod?

Use kubectl logs <pod-name> --previous to retrieve logs from the last crashed container instance. If the pod has multiple containers, add -c <container-name> to target the specific container in CrashLoopBackOff.

How do I fix CrashLoopBackOff?

Start by running kubectl describe pod and kubectl logs --previous to identify the root cause, then address it — most commonly by adjusting memory limits, correcting probe configurations, fixing missing dependencies, or resolving application errors.

How is CrashLoopBackOff different from ImagePullBackOff?

ImagePullBackOff means the container image couldn't be pulled. CrashLoopBackOff means the image pulled successfully but the container fails after starting. They look similar in kubectl get pods output but require completely different fixes.

Wrapping up

CrashLoopBackOff is one of the most visible failure states in Kubernetes but also one of the most misunderstood. The error label points to a pattern of failure, not the failure itself, and the diagnostic path starts with reading the right signals from the right commands.

Teams that resolve it quickly follow a consistent pattern: inspect events, read the previous container logs, and correlate failures with system behavior across the cluster. Shifting from reacting to errors to understanding them is what makes Kubernetes workloads stable at scale.

If your team is managing multiple clusters and needs visibility across all of them from a single place, check out OpManager Nexus.

Written by

Grace Nalini

Product Marketer, OpManager Nexus

Grace Nalini specializes in observability, cloud operations, Kubernetes, databases, and modern IT infrastructure. Her work focuses on translating complex technical concepts into practical insights that help IT operations, CloudOps, and platform engineering teams improve performance, reliability, and operational resilience.