{"record":{"id":"a829825db41475f3","repo":"abiosoft/colima","slug":"no-sha-entry-found-for-s-in-checksum-file","errorCode":null,"errorMessage":"no SHA entry found for '%s' in checksum file","messagePattern":"no SHA entry found for '(.+?)' in checksum file","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/downloader/sha.go","lineNumber":143,"sourceCode":"\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\t// format: \"<hash>  <filename>\" (two spaces) or \"<hash> *<filename>\" (binary mode)\n\t\tparts := strings.Fields(line)\n\t\tif len(parts) >= 2 {\n\t\t\thash := parts[0]\n\t\t\tfilename := strings.TrimPrefix(parts[len(parts)-1], \"*\")\n\n\t\t\tif filename == targetFilename || strings.HasSuffix(filename, \"/\"+targetFilename) {\n\t\t\t\treturn hash, nil\n\t\t\t}\n\t\t}\n\t}\n\n\tif err := scanner.Err(); err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn \"\", fmt.Errorf(\"no SHA entry found for '%s' in checksum file\", targetFilename)\n}\n","sourceCodeStart":125,"sourceCodeEnd":145,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/util/downloader/sha.go#L125-L145","documentation":"The checksum file parsed without scanner errors, but no line's filename matched the artifact basename (the matcher accepts an exact basename or a '/basename' suffix). The digest for this artifact simply is not in that file; this frequently masks a 200-status HTML response or a naming/arch mismatch between the artifact URL and the checksum entry.","triggerScenarios":"Artifact URL basename (e.g. image-arm64.qcow2) has no matching entry — different arch suffix, renamed file, checksum file from another release; the 'checksum file' is actually an HTML page served with status 200.","commonSituations":"Mirror renames artifacts but keeps old checksums; arch-specific downloads against an amd64-only checksum list; captive portals returning 200 HTML.","solutions":["Fetch the checksum file and grep for the artifact basename to see the entries that do exist","Align the artifact URL or the sha URL so basenames match (watch arch/version suffixes)","Point SHA.URL at the checksum file of the exact release","If upstream genuinely has no entry for the artifact, remove SHA from the Request"],"exampleFix":"# before: sha file lists lima-0.0.1-amd64.qcow2 but the URL downloads lima-0.0.1-arm64.qcow2\n# after: keep arch consistent between artifact and checksum source\ncurl -fsSL \"$SHA_URL\" | grep \"$(basename \"$ARTIFACT_URL\")\"","handlingStrategy":"try-catch","validationCode":"// pre-flight: confirm the checksum file references the artifact basename\nresp, err := http.Get(shaURL)\nif err != nil {\n    return err\n}\ndefer resp.Body.Close()\nbody, _ := io.ReadAll(io.LimitReader(resp.Body, 1<<20))\nif !strings.Contains(string(body), path.Base(artifactURL)) {\n    return fmt.Errorf(\"checksum file %q has no entry for %s\", shaURL, path.Base(artifactURL))\n}","typeGuard":null,"tryCatchPattern":"cacheFile, err := downloader.Download(host, req)\nif err != nil && strings.Contains(err.Error(), \"no SHA entry found\") {\n    // basenames drift between artifact and checksum file (arch/version suffixes)\n    // curl -fsSL \"$SHA_URL\" | grep \"$(basename \"$ARTIFACT_URL\")\"\n    // then fix req.URL / req.SHA, or drop req.SHA if upstream has no entry\n    return err\n}","preventionTips":["Keep artifact and checksum URLs sourced from the same release directory","Watch arch suffixes (amd64/arm64, x86_64/aarch64) when wiring SHA into Requests","Treat 'no SHA entry' on a mirror as a content problem, not a code problem"],"tags":["sha","checksum","download","config"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}