{"record":{"id":"0ffe86a2fcaf65f9","repo":"GoogleContainerTools/skaffold","slug":"getting-auth-config-w","errorCode":null,"errorMessage":"getting auth config: %w","messagePattern":"getting auth config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/docker/auth.go","lineNumber":244,"sourceCode":"\t\treturn DockerIndexName, true\n\t}\n\treturn val, false\n}\n\nfunc (l *localDaemon) encodedRegistryAuth(ctx context.Context, a AuthConfigHelper, image string) (string, error) {\n\tref, err := reference.ParseNormalizedNamed(image)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"parsing image name for registry: %w\", err)\n\t}\n\n\tconfigKey, official := parseRepositoryInfo(ref)\n\tif official {\n\t\tconfigKey = l.officialRegistry(ctx)\n\t}\n\n\tac, err := a.GetAuthConfig(ctx, configKey)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"getting auth config: %w\", err)\n\t}\n\n\treturn encodeAuthConfig(ac)\n}\n\nfunc encodeAuthConfig(authConfig types.AuthConfig) (string, error) {\n\tb, err := json.Marshal(authConfig)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn base64.URLEncoding.EncodeToString(b), nil\n}\n\nfunc (l *localDaemon) officialRegistry(ctx context.Context) string {\n\tserverAddress := \"https://index.docker.io/v1/\"\n\n\t// The daemon `/info` endpoint informs us of the default registry being used.\n\tinfo, err := l.apiClient.Info(ctx, client.InfoOptions{})","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/docker/auth.go#L226-L262","documentation":"Wraps a failure from a.GetAuthConfig(ctx, configKey) when obtaining credentials for the resolved registry key. Parse succeeded and the official-registry key was determined, but the credential lookup itself failed.","triggerScenarios":"encodedRegistryAuth calls GetAuthConfig; loadDockerConfig fails (bad docker config), the credential helper/credsStore errors, or no credentials can be resolved for the registry key.","commonSituations":"Broken credential helper binary (gcloud cred helper outdated); credsStore backend (e.g. desktop/keychain) unavailable; registry requires auth and none configured; expired credentials.","solutions":["Fix or reinstall the credential helper (e.g. `gcloud components update`; re-login docker)","Run `docker login <registry>` to populate credentials","Inspect the wrapped inner error to identify which helper/store failed","Check ~/.docker/config.json credsStore/credHelpers entries are valid"],"exampleFix":"// before\n~/.docker/config.json credHelpers -> gcr.io: \"gcr-auth-helper\" (missing binary)\n// after\ngcloud components install docker-credential-gcr\ndocker-credential-gcr configure-docker\n# or simply: docker login gcr.io","handlingStrategy":"try-catch","validationCode":"cf, err := config.Load(configDir)\nif err != nil { return err }\nfor reg, h := range cf.CredentialHelpers {\n  if _, err := exec.LookPath(h); err != nil {\n    return fmt.Errorf(\"cred helper %s for %s missing\", h, reg)\n  }\n}","typeGuard":null,"tryCatchPattern":"err := daemon.Push(ctx, image)\nif err != nil && strings.Contains(err.Error(), \"getting auth config\") {\n  return fmt.Errorf(\"registry auth failed; run `docker login <registry>` or fix cred helper: %w\", err)\n}","preventionTips":["Run docker login for every private registry used","Keep credential helpers installed and updated (gcloud components update)","Verify credsStore backends are available (e.g. keychain unlocked in CI)","Unwrap the inner error to identify the failing store"],"tags":["docker","auth","registry","credentials"],"backgroundTag":"docker-credential-lookup-failed","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"}