Skip to content

ImagePullBackOff weeks after the migration: your pods are still running, but the image they reference no longer exists anywhere

A running pod is no proof that its image exists. Registry drift breaks nothing when the mistake is made, and everything at the next restart. The audit and the fix.

Error message
ImagePullBackOff

In short

Symptom
A pod that had been running for weeks restarts and never comes back: ImagePullBackOff, failed to resolve reference: not found, and thousands of attempts that nobody notices.
Real cause
The manifest references a registry, or a tag, that no longer exists. Kubelet only pulls an image when a container starts: months can pass between the moment a reference becomes wrong and the moment it is used.
Fix
Inventory the images the cluster actually references, copy the repositories to the target registry before removing the source, and move to immutable tags updated by commit.
Prevention
A registry query after every deployment, and mutable tags forbidden by an automated check rather than by review.

The answer, in three lines

A running pod proves nothing about the availability of its image: kubelet only pulls an image when a container starts. Months can pass between the moment a reference becomes wrong and the moment it is used, so the failure has no visible link to its cause.

The real fix takes three steps. Inventory what the cluster actually references. Copy the images to the target registry before removing the source. Move to immutable tags, updated by a commit rather than by the state of the registry.

The symptom

A pod that had been running for weeks restarts for an ordinary reason (eviction, node upgrade, configuration change), and it never comes back:

$ kubectl get pods -n mon-app
NAME                        READY   STATUS             RESTARTS   AGE
web-6c9f8b7d5f-x2k4p        0/1     ImagePullBackOff   0          3d7h

$ kubectl describe pod web-6c9f8b7d5f-x2k4p -n mon-app
Events:
  Warning  Failed   4m (x21041 over 3d7h)  kubelet
    Failed to pull image "registre.interne:5000/mon-app/web:latest":
    failed to resolve reference: not found
  Warning  Failed   4m   kubelet  Error: ErrImagePull
  Normal   BackOff  4m (x21041 over 3d7h)  kubelet  Back-off pulling image

Kubelet made 21,041 attempts in three days and seven hours. Nobody noticed, because the service was still answering: the other replicas were running on an image already in the node's cache.

The worst case is the one where the deployment does not break when the mistake is made. You migrate, you check, everything is green. The failure arrives three weeks later, with no visible link to anything.

The wrong diagnosis

Second wrong lead: "the tag was pushed badly by the publishing pipeline". You re-run the pipeline, it pushes the image, and the pod comes back. The problem is hidden: it will return the next time some other deployment restarts.

The third is the most dangerous: "the pods are running, so the images exist". Every migration check quietly rests on that assumption, and it is false. A running container proves nothing about the availability of its image.

What is actually happening

The manifest references a registry, or a tag, that no longer exists, and nothing checks it as long as no pull is needed.

I observed four variants:

  1. The registry moved. The registry host name pointed, through a mesh network, at a server that was being retired. Nine deployments still referenced it, and the new server's registry was empty. Removing the old server from the network would have broken all nine at their first restart, and made any update impossible.
  2. The latest tag was overwritten or purged. The mon-app/web:latest image was replaced by different content, or deleted by a retention policy. The manifest itself did not change by one byte.
  3. The tag is a placeholder. A tag: "REPLACE_WITH_GIT_SHA" in a values file passes a chart's guards, whose non-empty check is satisfied by any non-empty string. It produces an obscure ImagePullBackOff at the first deployment.
  4. The image was never pushed. A service was built locally, deployed by hand, and never wired into the publishing pipeline.

All four variants share one mechanism, a time lag: kubelet only pulls an image when a container starts. Months can pass between the moment the reference becomes wrong and the moment it is used. The mistake and the symptom have no visible link, and the person diagnosing it is almost never the person who introduced the drift.

The fix

Step 1: The audit: inventory what is actually referenced

Before touching anything, list the images of every workload:

kubectl get deployments,statefulsets,daemonsets -A \
  -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{range .spec.template.spec.containers[*]}{.image}{" "}{end}{"\n"}{end}' \
  | sort | column -t

The output has to show two things: the distinct registry hosts (there should only be one), and every occurrence of :latest or of any other tag that can change.

Step 2: Migrating the images, if the registry changes

Copy from one registry to the other without going through a local Docker daemon:

skopeo copy \
  --src-creds "$SRC_USER:$SRC_PASS" --dest-creds "$DST_USER:$DST_PASS" \
  docker://ancien-registre.interne:5000/mon-app/web:<sha> \
  docker://nouveau-registre.interne:5000/mon-app/web:<sha>

Do this copy before removing the old registry from the network, for every repository inventoried in step 1, including the ones whose pods are running with no visible problem.

Step 3: The real fix: immutable tags

  image:
    repository: registre.interne:5000/mon-app/web
-   tag: latest
+   tag: "a1b2c3d4e5f6"     # git-sha, pushed by the publishing pipeline

Updating the tag then becomes a commit: the publishing pipeline opens a pull request on the manifest repository that updates the image.tag field. The deployed version is versioned data, and the state of the registry no longer decides it.

Step 4: The chart guard

Make the chart rendering fail on a placeholder, and not only on an empty value:

{{- if or (empty .Values.image.tag) (hasPrefix "REPLACE" .Values.image.tag) }}
{{- fail "image.tag must be a git-sha. Run the publishing pipeline first." }}
{{- end }}

Check (pass or fail)

# aucun tag mutable dans le cluster
kubectl get deployments -A -o jsonpath='{range .items[*]}{range .spec.template.spec.containers[*]}{.image}{"\n"}{end}{end}' \
  | grep -c ':latest$'          # doit afficher 0

# chaque image référencée existe VRAIMENT dans le registre cible
skopeo inspect --creds "$USER:$PASS" \
  docker://registre.interne:5000/mon-app/web:<sha> > /dev/null && echo OK

Almost nobody runs the second check: it queries the registry, while the other checks query the cluster.

Prevention

  • In CI, run a skopeo inspect on each referenced image after every deployment. It takes thirty seconds, and it catches the drift the day it appears instead of three weeks later.
  • In the manifest repository, forbid :latest and have an automated check enforce it. Human review does not hold this rule.
  • In the written migration procedure, add one explicit step: inventory the referenced images, copy them, verify they are present in the target, and only then remove the source. In the original case, that was the only real blocker of the migration, and it was not in the plan.
  • In the repository instruction file, write: "Images are tagged by git-sha. An agent never pushes latest and never changes an image.tag except through the publishing pipeline."

Why this matters with agents

Agents make this failure worse in three ways, and the third is the most expensive.

An agent will write latest, because it is the value in every public example. If its prompt does not forbid it, an agent generating a chart or a manifest produces a mutable tag. The deployment works, and everyone concludes that it is correct.

An agent checks that the pod is running, not that the image exists. That is the check that comes naturally, and it is not enough. kubectl get pods prints Running, the agent concludes the deployment is fine, and its mistake shows up nowhere.

With several agents, the drift multiplies and nobody can attribute it. Agents deploying in parallel push several images onto the same mutable tag, and the last one wins. Three weeks later the pod restarts and pulls code nobody recognises, or nothing at all. Without an immutable tag, nothing tells you which agent produced what is running, and the failure can no longer be reconstructed after the fact.

What this entry does not cover

In the neighbouring case, the image exists, but what is running is not what the repository describes. That is a wiring problem, and the registry has nothing to do with it.

A persistent volume destroyed by a GitOps sync also produces a deferred failure. It needs its own entry, which is not published yet.

Where this entry comes from

Four occurrences on personal infrastructure, between February and August 2026. The source contained a full authentication hash and two server addresses: none of the three appears here, not truncated and not as an example.


This entry is part of a notebook of 27 production failures hit between February and September 2026. Some are public and free: see the notebook.

The others are published as they are written, along with the modules and their exercises, as part of the paid product. In that product, the modules are in English; the exercises and the other entries are in French. Nothing on this page is a teaser for it.

Related notes

The method that handles this kind of failure