Fix Kubernetes ImagePullBackOff and ErrImagePull
ImagePullBackOff and ErrImagePull mean the node could not pull the image. Use the describe event to spot a wrong tag, registry auth, or a rate limit.
ImagePullBackOff and ErrImagePull mean the pod was scheduled to a node, but that node could not pull the container image, so the container never started. No application code has run yet. The common causes are the image name or tag, registry credentials, and the registry refusing the pull (rate limits). Pulls also fail on the network path from the node to the registry (DNS, timeouts) or on image compatibility (architecture, manifest format). The event text in kubectl describe pod tells you which.
| Status | Meaning (official docs) |
|---|---|
ErrImagePull | A general pull error (GKE docs: "a general, non-recoverable, error during the image pull process") |
ImagePullBackOff | The pull failed and Kubernetes keeps retrying with an increasing delay, up to 300 seconds (5 minutes) |
[1] Read the failure text in the events. The Failed line under Events carries the reason the registry returned.
$ kubectl describe pod <pod>Grouped by the messages listed in the GKE troubleshooting page (exact wording varies by runtime and registry):
| The message contains | Cause | Go to |
|---|---|---|
not found (repository … not found etc.) | Wrong name or tag, or the image was deleted | [2] |
401 Unauthorized, 403 Forbidden, failed to fetch oauth token | Missing credentials or no permission | [4] |
You have reached your pull rate limit | Docker Hub pull limit | [6] |
lookup … server misbehaving, dial tcp …: i/o timeout | The node cannot resolve or reach the registry | Network, below |
Pulling Schema 1 images have been deprecated … | The image manifest format does not suit the runtime | Compatibility, below |
These messages are typical cases, not a complete list. For anything else, pick the closest row by keyword (not found, unauthorized, timeout, manifest).
- Network — The GKE docs say to check the node's DNS (cluster DNS and the DNS server the node uses) for
server misbehaving, and firewalls and routes to the registry fori/o timeout. Trypingortraceroutefrom a node to the registry host. For nodes without external IPs, confirm there is a NAT or proxy path. - Compatibility — An image built for a different architecture than the node (for example an
amd64image on an Arm node) fails to pull. ComparearchitectureunderPlatformindocker manifest inspect --verbose <image>with the node's architecture, and rebuild for the right one if they differ. The GKE docs also note that containerd 2.0 no longer pulls Docker Schema 1 images; push old images again in a current format.
[2] Check the image name character by character. Print the value the pod actually has:
$ kubectl get pod <pod> -o jsonpath='{.spec.containers[*].image}'Two documented defaults send typos to unexpected places. With no registry host, Kubernetes assumes the Docker public registry (Docker Hub). With no tag, it assumes latest. So myteam/api:1.4.2 without your private registry host is looked up on Docker Hub and ends in not found or an auth error, and a missing tag asks for latest, which fails if that tag was never pushed. If the pod has init containers, check .spec.initContainers[*].image too.
[3] Pull the same image by hand. This is the check the official Debug Pods page suggests:
$ docker pull <image>If it pulls on your PC but not in the cluster, the name is right and the node's credentials or network differ. If your PC also gets not found, fix the name, the tag, or push the image. Confirm in the registry UI that the tag exists.
[4] For a private registry, attach imagePullSecrets. The Secret must be in the same namespace as the pod and of type kubernetes.io/dockerconfigjson (or kubernetes.io/dockercfg). Pods cannot see Secrets in other namespaces, so create one per namespace.
First check that ~/.docker/config.json on the machine that ran docker login actually holds credentials. Print key names only, not values:
$ grep -E '"(auth|credsStore|credHelpers)"' ~/.docker/config.json | cut -d: -f1If "auth" shows up, use the file method below. If there is only "credsStore" (or "credHelpers"), the credentials live in the OS credential store, not in this file. The official docs say that with a credentials store you see a credsStore entry instead of auth, and that you should create the Secret directly (the command-line method). A Secret made from that file leaves the auth error in place. When auth is present, create it from the config file:
$ kubectl create secret generic regcred -n <namespace> --from-file=.dockerconfigjson=<path/to/.docker/config.json> --type=kubernetes.io/dockerconfigjsonOr on the command line:
$ kubectl create secret docker-registry regcred -n <namespace> --docker-server=<registry-host> --docker-username=<user> --docker-password=<password> --docker-email=<email>⚠️ As the official docs warn, a password on the command line lands in your shell history and may be visible to other users on the same machine while kubectl runs. Prefer the file method when the file holds auth; if you used this one, remove it from history. Set --docker-server to the registry host in front of the image name.
Reference the Secret from the pod (or the Deployment's pod template). The official example file:
apiVersion: v1kind: Podmetadata: name: private-regspec: containers: - name: private-reg-container image: <your-private-image> imagePullSecrets: - name: regcred[5] Check the registry address inside the Secret. The official check command is below, but it prints the password too, so do not run it where others can see the screen or logs:
$ kubectl get secret regcred -n <namespace> --output="jsonpath={.data.\.dockerconfigjson}" | base64 --decodeThe keys under auths say which registries the credentials apply to. Per the Kubernetes docs, a key can be more than a bare host (my-registry.example): a path prefix (my-registry.example/images also matches my-registry.example/images/my-image) or a glob (*.my-registry.example) works too. Each * matches exactly one subdomain level, so *.kubernetes.io matches abc.kubernetes.io but not kubernetes.io. For Docker Hub, the official example key is https://index.docker.io/v1/. If the image name matches none of the keys under these rules, recreate the Secret for that address. On managed services with a cloud registry, the node's service account permissions can be the cause instead of a Secret; for a 403 the GKE docs say to check the Artifact Registry Reader role (roles/artifactregistry.reader).
[6] For the Docker Hub pull limit, authenticate or cache. Anonymous pulls count per public IP of the node, so many nodes or one shared NAT fill it fast. To see the remaining count and options, read Fix Docker Hub pull rate limit. In the cluster, a Docker Hub account Secret attached through imagePullSecrets as in [4] moves the pulls to the account limit.
[7] Make it pull again after the fix. An existing pod retries only after its delay (up to 5 minutes) runs out. Also check imagePullPolicy:
| Policy not set | Value set automatically |
|---|---|
Tag is :latest or no tag | Always |
A tag other than :latest, or a digest | IfNotPresent |
The value is set once, when the object is created, and does not follow later tag changes. A Deployment created with 1.4.2 and later switched to latest stays IfNotPresent, so a node holding an old latest will not pull again. Change the policy by hand in that case. The official docs also advise against :latest in production.
If the pod pulls the image and then shows CrashLoopBackOff, the next step is Find the cause of CrashLoopBackOff. If kubectl cannot reach the cluster at all, start with localhost:8080 was refused.