kopia/kopia · error

unable to download releases checksum

Error message

unable to download releases checksum

What it means

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.

Solutions

  1. Verify releaseName is a valid tag name (non-empty, URL-safe); re-encode if it contains special characters.
  2. Ensure repo.BuildGitHubRepo is set correctly at build time via ldflags.
  3. Check the wrapped cause with errors.Cause to confirm it is a url.Parse error.
Defensive patterns

Strategy: validation

Validate before calling

if releaseName == "" || strings.ContainsAny(releaseName, " \t\n") {
	// invalid release name would break the checksum URL; skip verification
}

Try / catch

if err := verifyGitHubReleaseIsComplete(ctx, rel); err != nil {
	return errors.Wrap(err, "unable to validate GitHub release")
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid URL" / "URL cannot be empty": fix the malformed or missing URL behind request-construction failures — this error's family across 50 libraries.

Related errors


AI-assisted analysis of kopia/kopia@82495e54b5 (2026-09-07). Data as JSON: /api/errors/89f19c63e18bd202. Report an issue: GitHub.

Appendix: source

Thrown at cli/update_check.go:143

	var responseObject struct {
		Name string `json:"name"`
	}

	if err := json.NewDecoder(resp.Body).Decode(&responseObject); err != nil {
		return "", errors.Wrap(err, "invalid GitHub API response")
	}

	return responseObject.Name, nil
}

// verifyGitHubReleaseIsComplete downloads checksum file to verify that the release is complete.
func verifyGitHubReleaseIsComplete(ctx context.Context, releaseName string) error {
	ctx, cancel := context.WithTimeout(ctx, githubTimeout)
	defer cancel()

	req, err := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf(checksumsURLFormat, repo.BuildGitHubRepo, releaseName), http.NoBody)
	if err != nil {
		return errors.Wrap(err, "unable to download releases checksum")
	}

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		return errors.Wrap(err, "unable to download releases checksum")
	}

	defer resp.Body.Close() //nolint:errcheck

	if resp.StatusCode != http.StatusOK {
		return errors.Errorf("invalid status code from GitHub: %v", resp.StatusCode)
	}

	return nil
}

func (c *App) maybeCheckForUpdates(ctx context.Context) (string, error) {
	if v := os.Getenv(c.EnvName(checkForUpdatesEnvar)); v != "" {

View on GitHub (pinned to 82495e54b5)