| title | Kubernetes ErrImagePull | |||||
|---|---|---|---|---|---|---|
| slug | kubernetes-errimagepull | |||||
| technologies |
|
|||||
| severity | high | |||||
| tags |
|
|||||
| related |
|
|||||
| last_reviewed | 2026-06-27 |
NAME READY STATUS RESTARTS AGE
worker-58b7c6d99f-q7wzt 0/1 ErrImagePull 0 18s
Warning Failed 17s kubelet Failed to pull image "ghcr.io/acme/worker:latest":
rpc error: code = Unknown desc = failed to pull and unpack image
"ghcr.io/acme/worker:latest": failed to resolve reference
"ghcr.io/acme/worker:latest": unexpected status from HEAD request to
https://ghcr.io/v2/acme/worker/manifests/latest: 401 Unauthorized
Warning Failed 17s kubelet Error: ErrImagePull
ErrImagePull is the immediate failure the kubelet reports the first time it
cannot pull a container image. It is the precursor to ImagePullBackOff: the
first one or two attempts surface as ErrImagePull, and after the kubelet begins
backing off, the status flips to ImagePullBackOff. Catching the error at the
ErrImagePull stage is useful because the event still carries the raw runtime
error (HTTP status, registry response) before back-off noise sets in.
- kubernetes (kubelet, container runtime, image service)
high — the container cannot start. The pod stays at 0/1 ready and the
workload has no healthy replica on that node until the pull succeeds.
- Missing or invalid registry credentials, returning
401 Unauthorizedor403 Forbidden. - A non-existent tag or repository, returning
404/manifest unknown. - The registry host is unresolvable or unreachable (
no such host,i/o timeout). - An expired or rotated pull-secret token that the ServiceAccount still references.
- TLS verification failure against a registry using a private CA the node does not trust.
When a pod is admitted, the kubelet invokes the runtime's image service to fetch
the image. The runtime performs a HEAD/GET on the registry manifest endpoint
using any supplied auth. The HTTP status of that request maps directly to the
error: 401/403 for auth, 404/manifest unknown for a bad reference, a
transport error for networking, and an x509/tls error for certificate trust.
ErrImagePull is simply the kubelet's wrapper around whichever stage failed; the
underlying registry status in the event message is the real signal.
# Full event chain including the raw HTTP status from the registry
kubectl describe pod <pod> -n <namespace>
# The exact image string requested
kubectl get pod <pod> -n <namespace> \
-o jsonpath='{range .spec.containers[*]}{.image}{"\n"}{end}'
# Which pull secrets the pod resolved
kubectl get pod <pod> -n <namespace> \
-o jsonpath='{.spec.imagePullSecrets[*].name}'
# Reproduce the pull on the node directly (read-only)
sudo crictl pull ghcr.io/acme/worker:latestWarning Failed kubelet Failed to pull image "...": ... 401 Unauthorized
Warning Failed kubelet Error: ErrImagePull
401/403 = credentials. 404 / manifest unknown = wrong tag or repo.
no such host = DNS. x509: certificate signed by unknown authority = registry
TLS trust. A successful crictl pull returning an image ID confirms the
credentials and reference are correct from that node.
-
For
401/403, recreate the pull secret with a current token and ensure it is referenced by the pod's ServiceAccount:kubectl create secret docker-registry ghcr \ --docker-server=ghcr.io --docker-username=<user> \ --docker-password=<token> -n <namespace> --dry-run=client -o yaml \ | kubectl apply -f -
-
For
404, correct the image tag/repo in the Deployment and avoid:latest. -
For DNS/network errors, fix node resolution or egress rules to the registry.
-
For TLS errors, install the registry's CA into the node trust store or the runtime's registry config.
kubectl describe pod <pod> -n <namespace> | grep -A2 Events
# Expect: "Normal Pulled Successfully pulled image", then container starts.- Use immutable digest references and validate them in CI.
- Rotate registry tokens through a controller (e.g. external-secrets) so pods never reference an expired secret.
- Pre-pull critical images onto nodes or use a pull-through cache.
kubernetes · pod · image · registry · production