{"record":{"id":"e9ee9d0718384498","repo":"GoogleContainerTools/skaffold","slug":"retrieving-image-config-w","errorCode":null,"errorMessage":"retrieving image config: %w","messagePattern":"retrieving image config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/image_util.go","lineNumber":46,"sourceCode":"\nfunc RetrieveConfigFile(ctx context.Context, tagged string, cfg Config) (*v1.ConfigFile, error) {\n\tif strings.ToLower(tagged) == \"scratch\" {\n\t\treturn nil, nil\n\t}\n\n\tvar cf *v1.ConfigFile\n\tvar err error\n\n\tlocalDocker, err := NewAPIClient(ctx, cfg)\n\tif err == nil {\n\t\tcf, err = localDocker.ConfigFile(context.Background(), tagged)\n\t}\n\tif err != nil {\n\t\t// No local Docker is available\n\t\tcf, err = RetrieveRemoteConfig(tagged, cfg, v1.Platform{})\n\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"retrieving image config: %w\", err)\n\t}\n\n\treturn cf, err\n}\n\nfunc RetrieveWorkingDir(ctx context.Context, tagged string, cfg Config) (string, error) {\n\tcf, err := RetrieveConfigFile(ctx, tagged, cfg)\n\tswitch {\n\tcase err != nil:\n\t\treturn \"\", err\n\tcase cf == nil:\n\t\treturn \"/\", nil\n\tcase cf.Config.WorkingDir == \"\":\n\t\tlog.Entry(context.TODO()).Debugf(\"Using default workdir '/' for %s\", tagged)\n\t\treturn \"/\", nil\n\tdefault:\n\t\treturn cf.Config.WorkingDir, nil\n\t}","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/image_util.go#L28-L64","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before: base image only exists locally, daemon down\n$ skaffold dev\n// after\n$ sudo systemctl start docker && docker pull gcr.io/my-proj/base:latest\n$ skaffold dev","handlingStrategy":"validation","validationCode":"// ensure the reference resolves either locally or remotely\nif !daemon.ImageExists(ctx, tagged) {\n    if _, err := remote.Head(tagged); err != nil {\n        return fmt.Errorf(\"image %q neither local nor pullable: %w\", tagged, err)\n    }\n}","typeGuard":null,"tryCatchPattern":"cf, err := RetrieveConfigFile(ctx, tagged, cfg)\nif err != nil && strings.Contains(err.Error(), \"retrieving image config\") {\n    return nil, fmt.Errorf(\"image %q not found locally or in registry; push it or fix the tag: %w\", tagged, err)\n}","preventionTips":["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."],"tags":["docker","image-config","registry","metadata"],"backgroundTag":"image-config-unavailable","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}