Skip to main content
DevOps & Docker · Developer Error Resolution Lab

Fix Kubernetes 'ImagePullBackOff' and 'ErrImagePull' Registry Errors

Resolve container image registry authentication failures, wrong image tags, or private registry credentials.

Triggered Error Message:

Failed to pull image 'ghcr.io/org/private-app:v1': rpc error: code = Unknown desc = failed to pull and unpack image: failed to resolve reference: unexpected status: 401 Unauthorized

Customize Solution for Your Environment
# Create registry secret in Kubernetes:
kubectl create secret docker-registry ghcr-auth \
  --docker-server=ghcr.io \
  --docker-username=YOUR_USER \
  --docker-password=YOUR_TOKEN \
  --docker-email=admin@example.com

# Then add to deployment manifest:
spec:
  imagePullSecrets:
    - name: ghcr-auth

Root Cause & Mechanism Analysis

Why does this error occur?

Typo in image name or tag, non-existent repository, or missing `imagePullSecrets` required to authenticate with private registries (Docker Hub, GHCR, AWS ECR).

Frequently Asked Questions

What is the difference between ErrImagePull and ImagePullBackOff?
`ErrImagePull` is the immediate error on the first attempt; `ImagePullBackOff` is the status as Kubernetes waits before retrying.
Browse All 35 Guides