{"record":{"id":"324962ffc6be01c8","repo":"vitessio/vitess","slug":"resolve-golang-digest-for-s-w","errorCode":null,"errorMessage":"resolve golang digest for %s: %w","messagePattern":"resolve golang digest for (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/tools/go-upgrade/go-upgrade.go","lineNumber":520,"sourceCode":"\t\t\treturn match\n\t\t}\n\n\t\treturn fmt.Sprintf(\"%s%s@%s\", prefix, golangDockerTag(goVersion, distro), digest)\n\t})\n\tif replaceErr != nil {\n\t\treturn \"\", replaceErr\n\t}\n\n\treturn replaced, nil\n}\n\n// resolveGolangImageDigest resolves the pinned digest for the given Go version and distro.\nfunc resolveGolangImageDigest(goVersion *version.Version, distro string) (string, error) {\n\tref := \"golang:\" + golangDockerTag(goVersion, distro)\n\n\tdigest, err := crane.Digest(ref, crane.WithPlatform(&gocr.Platform{OS: dockerPlatformOS, Architecture: dockerPlatformArch}))\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"resolve golang digest for %s: %w\", ref, err)\n\t}\n\n\treturn digest, nil\n}\n\n// golangDockerTag returns the Golang Docker tag for the given version and distro.\nfunc golangDockerTag(goVersion *version.Version, distro string) string {\n\treturn goVersion.String() + \"-\" + distro\n}\n\nfunc updateBootstrapVersionInCodebase(old, new string, newGoVersion *version.Version) error {\n\tif old == new {\n\t\treturn nil\n\t}\n\tfiles, err := getListOfFilesInPaths([]string{\n\t\t\"./Makefile\",\n\t})\n\tif err != nil {","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/tools/go-upgrade/go-upgrade.go#L502-L538","documentation":"resolveGolangImageDigest queries the container registry (via go-containerregistry's crane) for the digest of the golang:<tag> image on the target platform (linux/amd64 by default). Any registry/network/plumbing failure is wrapped with this message including the full image reference.","triggerScenarios":"Calling replaceGolangImageReferences during go-upgrade when crane.Digest fails: registry unreachable, image tag doesn't exist (unpublished tag), authentication required, rate limiting, or no manifest for the requested OS/architecture platform.","commonSituations":"Requesting a golang tag for a version/distro combination not yet published to Docker Hub; corporate proxy blocking registry access; Docker Hub rate limits on CI runners; offline environments.","solutions":["Verify the image tag exists: `docker manifest inspect golang:<tag>` — if not, the Go version/distro combo isn't published yet; wait or use an available tag","Check network/registry access and proxy settings; authenticate if needed (docker login / registry credentials)","If rate-limited, retry with backoff or use an authenticated Docker Hub account","Confirm the platform (linux/amd64) has a published manifest for the tag, or adjust dockerPlatformOS/dockerPlatformArch"],"exampleFix":"// before: transient rate-limit failure\ndigest, err := crane.Digest(ref, ...)\n// after: caller-side retry\nerr = retry.Do(func() error {\n    digest, err = crane.Digest(ref, crane.WithPlatform(&gocr.Platform{OS: \"linux\", Architecture: \"amd64\"}))\n    return err\n}, retry.Attempts(3), retry.Delay(time.Second))","handlingStrategy":"retry","validationCode":"ref := \"golang:\" + golangDockerTag(goVersion, distro)\n// reachability pre-check\nctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\ndefer cancel()\nif err := pingRegistry(ctx); err != nil {\n    return fmt.Errorf(\"registry unreachable; check network/credentials before resolving %s\", ref)\n}","typeGuard":null,"tryCatchPattern":"digest, err := resolveGolangImageDigest(goVersion, distro)\nif err != nil {\n    return retry.Do(func() error {\n        digest, err = resolveGolangImageDigest(goVersion, distro)\n        return err\n    }, retry.Attempts(3), retry.DelayType(retry.BackOffDelay))\n}","preventionTips":["Verify the golang tag exists on Docker Hub before resolving (docker manifest inspect)","Authenticate with the registry in CI to avoid rate limits","Configure proxy/HTTPS settings for corporate networks","Cache recently resolved digests to reduce registry calls"],"tags":["docker","registry","network","golang"],"backgroundTag":"registry-digest-resolution-failed","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}