{"record":{"id":"2f2d01575c805603","repo":"GoogleContainerTools/skaffold","slug":"getting-auth-config-for-q-w","errorCode":null,"errorMessage":"getting auth config for %q: %w","messagePattern":"getting auth config for %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/image.go","lineNumber":429,"sourceCode":"\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"getting digest: %w\", err)\n\t\t}\n\t}\n\n\treturn imageID, nil\n}\n\n// streamDockerMessages streams formatted json output from the docker daemon\nfunc streamDockerMessages(dst io.Writer, src io.Reader, auxCallback func(jsonstream.Message)) error {\n\ttermFd, isTerm := term.IsTerminal(dst)\n\treturn progress.DisplayJSONMessagesStream(src, dst, termFd, isTerm, auxCallback)\n}\n\n// Push pushes an image reference to a registry. Returns the image digest.\nfunc (l *localDaemon) Push(ctx context.Context, out io.Writer, ref string) (string, error) {\n\tregistryAuth, err := l.encodedRegistryAuth(ctx, DefaultAuthHelper, ref)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"getting auth config for %q: %w\", ref, err)\n\t}\n\n\t// Quick check if the image was already pushed (ignore any error).\n\tif alreadyPushed, digest, err := l.isAlreadyPushed(ctx, ref, registryAuth); alreadyPushed && err == nil {\n\t\treturn digest, nil\n\t}\n\n\trc, err := l.apiClient.ImagePush(ctx, ref, client.ImagePushOptions{\n\t\tRegistryAuth: registryAuth,\n\t})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"%s %q: %w\", sErrors.PushImageErr, ref, err)\n\t}\n\tdefer rc.Close()\n\n\tvar digest string\n\tauxCallback := func(msg jsonstream.Message) {\n\t\tif msg.Aux == nil {","sourceCodeStart":411,"sourceCodeEnd":447,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/image.go#L411-L447","documentation":"Push needs registry credentials for the referenced image before calling ImagePush. If encodedRegistryAuth (via DefaultAuthHelper) cannot produce auth config for the registry, Push aborts with `getting auth config for <ref>`. This is almost always a registry authentication problem, not a Docker build problem.","triggerScenarios":"localDaemon.Push called with a ref whose registry host has no resolvable credentials — no docker login state for the registry, malformed ~/.docker/config.json, or a credential helper that fails for the registry.","commonSituations":"Forgetting `docker login` before pushing to a private registry (ECR, GCR, Artifactory); credential helper binaries missing or failing (docker-credential-ecr-login, gcloud auth); pushing to a registry host not covered by any auth entry.","solutions":["Run `docker login <registry>` (or cloud-specific login like `gcloud auth login` / `aws ecr get-login`) before pushing","Verify ~/.docker/config.json contains a valid auths/credHelpers entry for the registry host","Ensure the required credential helper binary is installed and on PATH","Check the wrapped inner error for the specific auth-helper failure"],"exampleFix":"// before\nskaffold run   # push to gcr.io without auth\n// after\ngcloud auth configure-docker\nskaffold run","handlingStrategy":"validation","validationCode":"registry := extractRegistryHost(ref)\ncfg := loadDockerConfig()\nif !hasAuthEntry(cfg, registry) {\n\treturn fmt.Errorf(\"no credentials for %s; run docker login %s\", registry, registry)\n}","typeGuard":null,"tryCatchPattern":"digest, err := daemon.Push(ctx, out, ref)\nif err != nil && strings.Contains(err.Error(), \"getting auth config\") {\n\treturn fmt.Errorf(\"run docker login for %s first: %w\", ref, err)\n}","preventionTips":["Always `docker login <registry>` (or cloud equivalent) before pushing","Ensure credential helper binaries are installed in CI images","Validate ~/.docker/config.json covers the registry host you push to"],"tags":["docker","registry","authentication"],"backgroundTag":"missing-auth-registry","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"}