{"record":{"id":"89f19c63e18bd202","repo":"kopia/kopia","slug":"unable-to-download-releases-checksum","errorCode":null,"errorMessage":"unable to download releases checksum","messagePattern":"unable to download releases checksum","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/update_check.go","lineNumber":143,"sourceCode":"\tvar responseObject struct {\n\t\tName string `json:\"name\"`\n\t}\n\n\tif err := json.NewDecoder(resp.Body).Decode(&responseObject); err != nil {\n\t\treturn \"\", errors.Wrap(err, \"invalid GitHub API response\")\n\t}\n\n\treturn responseObject.Name, nil\n}\n\n// verifyGitHubReleaseIsComplete downloads checksum file to verify that the release is complete.\nfunc verifyGitHubReleaseIsComplete(ctx context.Context, releaseName string) error {\n\tctx, cancel := context.WithTimeout(ctx, githubTimeout)\n\tdefer cancel()\n\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf(checksumsURLFormat, repo.BuildGitHubRepo, releaseName), http.NoBody)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unable to download releases checksum\")\n\t}\n\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"unable to download releases checksum\")\n\t}\n\n\tdefer resp.Body.Close() //nolint:errcheck\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn errors.Errorf(\"invalid status code from GitHub: %v\", resp.StatusCode)\n\t}\n\n\treturn nil\n}\n\nfunc (c *App) maybeCheckForUpdates(ctx context.Context) (string, error) {\n\tif v := os.Getenv(c.EnvName(checkForUpdatesEnvar)); v != \"\" {","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/cli/update_check.go#L125-L161","documentation":"verifyGitHubReleaseIsComplete downloads the release's checksums.txt.sig file to confirm the release is fully published. This error wraps http.NewRequestWithContext failures when constructing the GET for https://github.com/<repo>/releases/download/<release>/checksums.txt.sig. Like line 112, this is nearly always an invalid URL, e.g. when releaseName is empty or contains characters that break URL parsing.","triggerScenarios":"http.NewRequestWithContext fails building the checksum download request — malformed URL from fmt.Sprintf(checksumsURLFormat, repo.BuildGitHubRepo, releaseName), typically an empty repo name or an invalid/empty releaseName.","commonSituations":"A custom build with empty repo.BuildGitHubRepo; a release whose name contains spaces or characters needing percent-encoding; calling the API with a releaseName that came back empty from a nameless GitHub release object.","solutions":["Verify releaseName is a valid tag name (non-empty, URL-safe); re-encode if it contains special characters.","Ensure repo.BuildGitHubRepo is set correctly at build time via ldflags.","Check the wrapped cause with errors.Cause to confirm it is a url.Parse error."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if releaseName == \"\" || strings.ContainsAny(releaseName, \" \\t\\n\") {\n\t// invalid release name would break the checksum URL; skip verification\n}","typeGuard":null,"tryCatchPattern":"if err := verifyGitHubReleaseIsComplete(ctx, rel); err != nil {\n\treturn errors.Wrap(err, \"unable to validate GitHub release\")\n}","preventionTips":["Ensure release names come straight from the GitHub API name field (valid tag names).","Set repo.BuildGitHubRepo correctly at build time.","Treat this as a guard against incomplete releases — failure means the release is not ready, not a local fault."],"tags":["http","url","github-api","release"],"backgroundTag":"invalid-url","analyzedSha":"82495e54b584c1ef6073c9e1be048f57f8aef078","analyzedAt":"2026-09-07T20:35:21.689Z","contentChangedAt":"2026-09-07T20:35:21.689Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}