GoogleContainerTools/skaffold · error
retrieving image config: %w
Error message
retrieving image config: %w
What it means
RetrieveConfigFile resolves an image's config by first trying a local Docker daemon; if no local daemon is available it falls back to RetrieveRemoteConfig (go-containerregistry remote). If both paths fail, the error is wrapped as "retrieving image config: %w". Called by RetrieveWorkingDir and RetrieveLabels, it means neither the local daemon nor the remote registry could supply the image metadata.
Source
Thrown at pkg/skaffold/docker/image_util.go:46
func RetrieveConfigFile(ctx context.Context, tagged string, cfg Config) (*v1.ConfigFile, error) {
if strings.ToLower(tagged) == "scratch" {
return nil, nil
}
var cf *v1.ConfigFile
var err error
localDocker, err := NewAPIClient(ctx, cfg)
if err == nil {
cf, err = localDocker.ConfigFile(context.Background(), tagged)
}
if err != nil {
// No local Docker is available
cf, err = RetrieveRemoteConfig(tagged, cfg, v1.Platform{})
}
if err != nil {
return nil, fmt.Errorf("retrieving image config: %w", err)
}
return cf, err
}
func RetrieveWorkingDir(ctx context.Context, tagged string, cfg Config) (string, error) {
cf, err := RetrieveConfigFile(ctx, tagged, cfg)
switch {
case err != nil:
return "", err
case cf == nil:
return "/", nil
case cf.Config.WorkingDir == "":
log.Entry(context.TODO()).Debugf("Using default workdir '/' for %s", tagged)
return "/", nil
default:
return cf.Config.WorkingDir, nil
}View on GitHub (pinned to a1189de023)
Solutions
- Ensure the image exists: either build/pull it locally (`docker pull <tag>`) or push it to an accessible registry.
- Authenticate for the remote registry so RetrieveRemoteConfig can read the manifest (`docker login`, `gcloud auth configure-docker`).
- Fix the image reference in the config — verify with `docker manifest inspect <tag>`.
- Start the local Docker daemon so the local-daemon path succeeds instead of falling back to remote.
Example fix
// before: base image only exists locally, daemon down $ skaffold dev // after $ sudo systemctl start docker && docker pull gcr.io/my-proj/base:latest $ skaffold dev
Defensive patterns
Strategy: validation
Validate before calling
// ensure the reference resolves either locally or remotely
if !daemon.ImageExists(ctx, tagged) {
if _, err := remote.Head(tagged); err != nil {
return fmt.Errorf("image %q neither local nor pullable: %w", tagged, err)
}
} Try / catch
cf, err := RetrieveConfigFile(ctx, tagged, cfg)
if err != nil && strings.Contains(err.Error(), "retrieving image config") {
return nil, fmt.Errorf("image %q not found locally or in registry; push it or fix the tag: %w", tagged, err)
} Prevention
- Push base images referenced by configs to an accessible registry.
- Configure registry credentials for every private base image.
- Validate image refs in skaffold.yaml with `docker manifest inspect` in CI.
- Keep the local Docker daemon healthy so the local fast-path works.
When it happens
Trigger: Calling RetrieveConfigFile(ctx, tagged, cfg) when the local daemon lacks/errs on the image AND RetrieveRemoteConfig fails — image not present locally, not published to any registry, remote registry auth missing, or malformed image reference.
Common situations: Referencing a base image built locally but never pushed while the daemon is unreachable, private base image with no `docker login` / credential helper configured, typo in the image name/tag in skaffold.yaml, offline environment with no local image.
Related errors
- getting auth config: %w
- getting auth config for %q: %w
- %s %q: %w
- pulling image from repository: %w
- getting image: %w
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/e9ee9d0718384498.
Report an issue: GitHub.