Init:Error
KubernetesERRORNotablePod StateHIGH confidence

Init container exited with an error

Production Risk

Application container is completely blocked from starting.

What this means

Init:Error means an init container exited with a non-zero code on its first or current attempt, before the backoff timer kicks in (which would show Init:CrashLoopBackOff). The application container is blocked until the init container succeeds. Diagnosis follows the same path as Init:CrashLoopBackOff but represents an earlier stage.

Why it happens
  1. 1Init container command failed on first execution
  2. 2Required resource (ConfigMap, Secret, service endpoint) not available
  3. 3Permission denied when init container tries to modify shared volumes
How to reproduce

Pod transitions to Init:Error immediately after the init container exits.

trigger — this will error
trigger — this will error
kubectl get pods
# NAME    READY   STATUS       RESTARTS   AGE
# mypod   0/1     Init:Error   0          30s

kubectl logs mypod -c init-container-name

expected output

NAME    READY   STATUS       RESTARTS   AGE
mypod   0/1     Init:Error   0          30s

Fix

Read init container logs immediately

WHEN Pod just entered Init:Error

Read init container logs immediately
kubectl logs mypod -c init-container-name
kubectl describe pod mypod | grep -A 10 "Init Containers:"

Why this works

Captures logs before the pod is restarted and enters CrashLoopBackOff.

Sources
Official documentation ↗

Kubernetes Documentation

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Kubernetes errors