ImagePullBackOff and ErrImagePull: the node cannot get your image

Reproduced on k3s v1.31.5 (k3d) with kubectl v1.36.1.

What you see

$ kubectl get pod imgpull-demo -n lab
NAME           READY   STATUS             RESTARTS   AGE
imgpull-demo   0/1     ImagePullBackOff   0          2m35s

$ kubectl get events -n lab --field-selector involvedObject.name=imgpull-demo --sort-by=.lastTimestamp
LAST SEEN   TYPE      REASON      OBJECT             MESSAGE
69s         Normal    Pulling     pod/imgpull-demo   Pulling image "nginx:1.99.99-doesnotexist"
68s         Warning   Failed      pod/imgpull-demo   Failed to pull image "nginx:1.99.99-doesnotexist": rpc error: code = NotFound desc = failed to pull and unpack image "docker.io/library/nginx:1.99.99-doesnotexist": failed to resolve reference "docker.io/library/nginx:1.99.99-doesnotexist": docker.io/library/nginx:1.99.99-doesnotexist: not found
68s         Warning   Failed      pod/imgpull-demo   Error: ErrImagePull
40s         Warning   Failed      pod/imgpull-demo   Error: ImagePullBackOff
26s         Normal    BackOff     pod/imgpull-demo   Back-off pulling image "nginx:1.99.99-doesnotexist"

What it means

Before a container can start, the container runtime on the node must pull its image. If the pull fails, the container waits with ErrImagePull. The kubelet then retries with a growing delay of up to five minutes. It shows ImagePullBackOff while it waits.

RESTARTS stays at 0 because no container has run yet. Nothing inside the pod can tell you more. All the useful detail is in the Failed event message, which is the registry's or runtime's own error.

Common causes

The tag or name does not exist

A typo, a tag that was never pushed or an image that was deleted. Short names without a registry default to Docker Hub.

How to tell: The event says not found or manifest unknown.

Missing or wrong registry credentials

The image is private and the pod has no imagePullSecrets, or the secret is in another namespace or has the wrong server name.

How to tell: The event says unauthorized, authentication required, denied or 403 Forbidden.

Expired registry token

Some registries issue short-lived tokens. If the token in the pull secret is not refreshed, pulls start failing on a schedule.

How to tell: Pulls worked before and now fail with unauthorized, while the image and secret name are unchanged.

Registry rate limit

Anonymous or free-tier pulls from public registries are rate limited. Busy clusters that pull often hit the cap.

How to tell: The event mentions toomanyrequests or 429.

The node cannot reach the registry

DNS, a firewall, a proxy or a missing NAT route stops the node from connecting. Private clusters often hit this.

How to tell: The event shows dial tcp, i/o timeout, no such host or TLS errors.

Wrong CPU architecture

The image was built only for amd64 and the node is arm64, or the other way around.

How to tell: The event says no match for platform in manifest.

The node is out of disk space

A large image needs room on the node to download and unpack. If the node disk fills up during the pull, the runtime gives up and the pull fails.

How to tell: The event mentions no space left on device. The node may also show a DiskPressure condition.

How to diagnose it

  1. kubectl get events -n <namespace> --field-selector involvedObject.name=<pod> --sort-by=.lastTimestamp

    Read the full Failed message. It tells you which of the causes above you have.

  2. kubectl get pod <pod> -n <namespace> -o jsonpath='{.spec.containers[*].image}'

    Check the exact image string for typos and the registry host. Compare it with what your CI pushed.

  3. kubectl get pod <pod> -n <namespace> -o jsonpath='{.spec.imagePullSecrets}'

    Empty output means no pull secret is attached to the pod or its service account.

  4. kubectl get secret <pull-secret> -n <namespace> -o jsonpath='{.type}'

    The secret must exist in the same namespace as the pod and be of type kubernetes.io/dockerconfigjson.

  5. kubectl get secret <pull-secret> -n <namespace> -o jsonpath='{.data.\.dockerconfigjson}' | base64 -d

    The registry host under auths must match the host in the image string. Credentials for one registry do not help with an image on another.

  6. docker manifest inspect <registry>/<image>:<tag>

    Run it from a machine that can reach the registry. An error means the tag was never pushed or you have no access. The platforms listed show which CPU architectures the image was built for.

  7. kubectl get pod <pod> -n <namespace> -o wide

    Note the node. If pods on some nodes pull fine and others fail, look at that node's network path or architecture.

How to fix it

Correct the image reference

Fix the tag or name. Better still, deploy by digest so the reference cannot drift.

Trade-off: Digests are harder to read in manifests and need your CI to write them in.

Add a pull secret

Create a docker-registry secret in the pod's namespace and reference it in the pod spec or the service account.

kubectl create secret docker-registry regcred -n <namespace> \
  --docker-server=<registry> --docker-username=<user> --docker-password=<password>
kubectl patch serviceaccount default -n <namespace> \
  -p '{"imagePullSecrets":[{"name":"regcred"}]}'

Trade-off: The secret is one more credential to rotate. For short-lived tokens you need a refresher, or use the node's cloud identity instead.

Use a mirror or pull-through cache

Serve images from a registry inside your network. This avoids public rate limits and outbound network issues.

Trade-off: You now run and pay for a registry. It must stay in sync and be highly available or it becomes the new failure point.

Build multi-arch images

Publish images for every node architecture you run, or pin the workload to matching nodes with a nodeSelector.

Trade-off: Multi-arch builds take longer in CI. A nodeSelector limits where the pod can run.

How to stop it coming back

  • Fail the pipeline if the image tag does not exist in the registry before you deploy.
  • Avoid the latest tag. Use immutable tags or digests.
  • Watch for ErrImagePull across the cluster. A burst of them often means a registry or credential problem, not one bad deploy.
  • Pre-pull large or critical images on new nodes so a scale-up does not depend on the registry.

How KubeGraf investigates it

Specialist agents pull the logs, events, metrics, workloads and recent deploys for the failing workload into one view. How KubeGraf handles Kubernetes incidents.

Frequently asked questions

What is the difference between ErrImagePull and ImagePullBackOff?

ErrImagePull is the pull failing. ImagePullBackOff is the kubelet waiting before the next try, with a growing delay of up to five minutes. Both have the same cause.

What does failed to pull image mean?

The container runtime on the node asked the registry for the image and got an error. The event holds the registry's own error, such as not found, unauthorized or toomanyrequests. That message tells you which fix you need.

How do I use imagePullSecrets for a private registry?

Create a docker-registry secret in the pod's namespace. Reference it under imagePullSecrets in the pod spec or on the service account. The registry host in the secret must match the host in the image name.

How do I avoid the Docker Hub rate limit?

Docker Hub rate limits pulls from anonymous users and accounts without a paid plan. The event then mentions toomanyrequests or 429. Pull with an authenticated account, or serve images from a mirror or pull through cache in your network.

Last updated . Try KubeGraf Freemium.

Related

Kubernetes documentation