cli/cli · error

checksum not found for %s

Error message

checksum not found for %s

What it means

Thrown by the checksum verification step when installing the Copilot CLI agent: the downloaded checksums file was parsed line by line, but no line's filename column matched the expected archive name (e.g. gh-copilot-linux-amd64.zip). It means the release asset list and the checksums file are out of sync, or the archive name was computed for the wrong platform.

Source

Thrown at pkg/cmd/copilot/copilot.go:372

	// - "<checksum>  <filename>" (two whitespaces)
	// - "<checksum> <filename>"
	scanner := bufio.NewScanner(resp.Body)
	for scanner.Scan() {
		line := scanner.Text()
		fields := strings.Fields(line)
		if len(fields) >= 2 {
			checksum := fields[0]
			filename := fields[1]
			if filename == archiveName {
				return checksum, nil
			}
		}
	}
	if err := scanner.Err(); err != nil {
		return "", fmt.Errorf("failed to read checksums: %w", err)
	}

	return "", fmt.Errorf("checksum not found for %s", archiveName)
}

// extractZip reads a ZIP archive at path and extracts its contents into destDir.
// It returns an error if the archive cannot be read,
// or if any file or directory within the archive cannot be created or written.
func extractZip(path, destDir string) error {
	zipReader, err := zip.OpenReader(path)
	if err != nil {
		return fmt.Errorf("failed to open zip: %w", err)
	}
	defer zipReader.Close()

	absPath, err := safepaths.ParseAbsolute(destDir)
	if err != nil {
		return err
	}

	// As of the time of writing, ghzip.ExtractZip will safely skip files that

View on GitHub (pinned to 0eeec0b92e)

Solutions

  1. Check the release page for the pinned Copilot CLI version and confirm a checksums entry exists for your OS/arch combination
  2. Print/inspect the downloaded checksums file content in a debugger to see whether it is valid text or an error page
  3. Update gh to the latest version so it tracks the current release asset naming
  4. If a platform asset is genuinely missing, file an issue in the cli/cli repo noting the archive name from the error message
Defensive patterns

Strategy: validation

Validate before calling

// before extracting, confirm the archive name appears in checksums.txt
lines := strings.Split(string(checksumBody), "\n")
found := false
for _, l := range lines {
    fields := strings.Fields(l)
    if len(fields) >= 2 && fields[1] == archiveName {
        found = true
        break
    }
}
if !found {
    return fmt.Errorf("release has no checksum for %s; check supported platforms", archiveName)
}

Prevention

When it happens

Trigger: findChecksum iterates the checksums file, splits each line into fields, and only returns when fields[1] equals archiveName. Reaching the end without a match produces this error. Happens when the platform detection (OS/arch) yields an archive name absent from checksums.txt, or the checksums file was truncated/empty after download.

Common situations: A Copilot CLI release published without checksums for a new platform (e.g. new arch like arm64 when only amd64 was published), a proxy/firewall returning an HTML error page instead of the checksums file (parse finds no matching line), or a version pin pointing at an old release with different asset naming.

Related errors


AI-assisted analysis of cli/cli@0eeec0b92e (2026-08-15). Data as JSON: /api/errors/89181d0d37d98227. Report an issue: GitHub.