{"record":{"id":"89181d0d37d98227","repo":"cli/cli","slug":"checksum-not-found-for-s","errorCode":null,"errorMessage":"checksum not found for %s","messagePattern":"checksum not found for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/copilot/copilot.go","lineNumber":372,"sourceCode":"\t// - \"<checksum>  <filename>\" (two whitespaces)\n\t// - \"<checksum> <filename>\"\n\tscanner := bufio.NewScanner(resp.Body)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tfields := strings.Fields(line)\n\t\tif len(fields) >= 2 {\n\t\t\tchecksum := fields[0]\n\t\t\tfilename := fields[1]\n\t\t\tif filename == archiveName {\n\t\t\t\treturn checksum, nil\n\t\t\t}\n\t\t}\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to read checksums: %w\", err)\n\t}\n\n\treturn \"\", fmt.Errorf(\"checksum not found for %s\", archiveName)\n}\n\n// extractZip reads a ZIP archive at path and extracts its contents into destDir.\n// It returns an error if the archive cannot be read,\n// or if any file or directory within the archive cannot be created or written.\nfunc extractZip(path, destDir string) error {\n\tzipReader, err := zip.OpenReader(path)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to open zip: %w\", err)\n\t}\n\tdefer zipReader.Close()\n\n\tabsPath, err := safepaths.ParseAbsolute(destDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// As of the time of writing, ghzip.ExtractZip will safely skip files that","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/cli/cli/blob/0eeec0b92edbe70199f9768522f831d3534f41ad/pkg/cmd/copilot/copilot.go#L354-L390","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the release page for the pinned Copilot CLI version and confirm a checksums entry exists for your OS/arch combination","Print/inspect the downloaded checksums file content in a debugger to see whether it is valid text or an error page","Update gh to the latest version so it tracks the current release asset naming","If a platform asset is genuinely missing, file an issue in the cli/cli repo noting the archive name from the error message"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before extracting, confirm the archive name appears in checksums.txt\nlines := strings.Split(string(checksumBody), \"\\n\")\nfound := false\nfor _, l := range lines {\n    fields := strings.Fields(l)\n    if len(fields) >= 2 && fields[1] == archiveName {\n        found = true\n        break\n    }\n}\nif !found {\n    return fmt.Errorf(\"release has no checksum for %s; check supported platforms\", archiveName)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the HTTP status and content-type of the checksums download before parsing it","Fail fast with a clear message when the platform triple has no matching release asset","Pin releases known to publish checksums for all supported platforms"],"tags":["copilot","checksum","release-assets","install"],"backgroundTag":null,"analyzedSha":"0eeec0b92edbe70199f9768522f831d3534f41ad","analyzedAt":"2026-08-15T12:31:05.478Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}