{"record":{"id":"e407770b7d5e9135","repo":"github/copilot-sdk","slug":"failed-to-download-checksums-w","errorCode":null,"errorMessage":"failed to download checksums: %w","messagePattern":"failed to download checksums: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/cmd/bundler/main.go","lineNumber":969,"sourceCode":"\t\tfields := strings.Fields(line)\n\t\tif len(fields) != 2 || !hashPattern.MatchString(fields[0]) {\n\t\t\tcontinue\n\t\t}\n\t\tchecksums[strings.TrimPrefix(fields[1], \"*\")] = strings.ToLower(fields[0])\n\t}\n\treturn checksums\n}\n\nfunc getReleaseChecksum(version, assetName string) (string, error) {\n\tbaseURL := cliDownloadBaseURL()\n\tcacheKey := baseURL + \"\\x00\" + version\n\tchecksums, ok := releaseChecksumCache[cacheKey]\n\tif !ok {\n\t\tchecksumsURL := fmt.Sprintf(\"%s/v%s/SHA256SUMS.txt\", baseURL, version)\n\t\tfmt.Printf(\"Downloading checksums from %s...\\n\", checksumsURL)\n\t\tresp, err := releaseHTTPClient.Get(checksumsURL)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"failed to download checksums: %w\", err)\n\t\t}\n\t\tdefer resp.Body.Close()\n\t\tif resp.StatusCode != http.StatusOK {\n\t\t\treturn \"\", fmt.Errorf(\"failed to download checksums: %s\", resp.Status)\n\t\t}\n\t\tcontents, err := io.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"failed to read checksums: %w\", err)\n\t\t}\n\t\tchecksums = parseReleaseChecksums(string(contents))\n\t\treleaseChecksumCache[cacheKey] = checksums\n\t}\n\tchecksum, ok := checksums[assetName]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"SHA256SUMS.txt does not contain %s\", assetName)\n\t}\n\treturn checksum, nil\n}","sourceCodeStart":951,"sourceCodeEnd":987,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/go/cmd/bundler/main.go#L951-L987","documentation":"getReleaseChecksum fetches SHA256SUMS.txt for a release version and wraps network-level failures of that HTTP GET in this error. downloadCLIBinary needs the checksum to verify the package before extraction, so a failed download aborts it.","triggerScenarios":"releaseHTTPClient.Get(checksumsURL) returns a transport error when downloading <baseURL>/v<version>/SHA256SUMS.txt: DNS failure, connection refused/reset, TLS error, timeout, or offline machine.","commonSituations":"No internet access or corporate proxy blocking the host; wrong baseURL or version producing an unreachable URL; firewall/VPN issues; releaseHTTPClient timeout too short on slow networks.","solutions":["Check network connectivity and proxy settings (HTTP_PROXY/HTTPS_PROXY) on the build machine","Verify baseURL and cliVersion are correct and the host is reachable (curl the checksumsURL)","Increase releaseHTTPClient timeout or configure a proxy-aware client","Retry the build if it was a transient network error"],"exampleFix":"// before\nresp, err := releaseHTTPClient.Get(checksumsURL)\nif err != nil {\n\treturn \"\", fmt.Errorf(\"failed to download checksums: %w\", err)\n}\n// after\nif err := pingHost(baseURL); err != nil {\n\treturn \"\", fmt.Errorf(\"checksum host unreachable (check network/proxy): %w\", err)\n}\nresp, err := releaseHTTPClient.Get(checksumsURL)\nif err != nil {\n\treturn \"\", fmt.Errorf(\"failed to download checksums: %w\", err)\n}","handlingStrategy":"retry","validationCode":"u, err := url.Parse(fmt.Sprintf(\"%s/v%s/SHA256SUMS.txt\", baseURL, version))\nif err != nil || u.Scheme != \"https\" && u.Scheme != \"http\" {\n\treturn fmt.Errorf(\"invalid checksums URL: %s\", u)\n}","typeGuard":null,"tryCatchPattern":"resp, err := releaseHTTPClient.Get(checksumsURL)\nif err != nil {\n\tvar netErr net.Error\n\tif errors.As(err, &netErr) && netErr.Timeout() {\n\t\t// retry with backoff\n\t}\n\treturn \"\", fmt.Errorf(\"failed to download checksums: %w\", err)\n}","preventionTips":["Check connectivity/proxy env (HTTPS_PROXY) on build machines","Set a sane HTTP client timeout (not too short for CI networks)","Cache checksums per release so a single fetch failure is cheap to retry","Verify baseURL/version with curl before long build pipelines"],"tags":["network","http","download","go"],"backgroundTag":"http-request-failed","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}