{"record":{"id":"632c622a214ebfb7","repo":"xpzouying/xiaohongshu-mcp","slug":"sha256sums-s","errorCode":null,"errorMessage":"SHA256SUMS 中未找到 %s","messagePattern":"SHA256SUMS 中未找到 (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"browser/browser_download.go","lineNumber":167,"sourceCode":"\nfunc fetchExpectedSHA(asset string) (string, error) {\n\tresp, err := (&http.Client{Timeout: 30 * time.Second}).Get(browserURL(\"SHA256SUMS\"))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", fmt.Errorf(\"获取 SHA256SUMS: HTTP %d\", resp.StatusCode)\n\t}\n\tsc := bufio.NewScanner(resp.Body)\n\tfor sc.Scan() {\n\t\t// 格式：<hash>␠␠<filename>\n\t\tfields := strings.Fields(sc.Text())\n\t\tif len(fields) == 2 && fields[1] == asset {\n\t\t\treturn fields[0], nil\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"SHA256SUMS 中未找到 %s\", asset)\n}\n\nfunc findBinary(dir, binName string) string {\n\tvar found string\n\t_ = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {\n\t\tif err != nil || info.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\tif filepath.Base(path) == binName {\n\t\t\tfound = path\n\t\t\treturn io.EOF // 提前结束\n\t\t}\n\t\treturn nil\n\t})\n\tif found != \"\" {\n\t\tif err := os.Chmod(found, 0o755); err != nil {\n\t\t\tlogrus.Debugf(\"chmod %s: %v\", found, err)\n\t\t}","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/xpzouying/xiaohongshu-mcp/blob/332d196854a9eac0d2b8c2c0e3d0cc43139d724c/browser/browser_download.go#L149-L185","documentation":"fetchExpectedSHA scans every line of the downloaded SHA256SUMS file looking for an entry whose second whitespace-separated field equals the asset filename. This error is thrown when the file was fetched successfully but no line matches the expected asset name.","triggerScenarios":"verifySHA256 calls fetchExpectedSHA with an asset filename (the browser archive basename) and strings.Fields over each SHA256SUMS line never yields len(fields)==2 with fields[1] == asset — the asset name is absent or the line format differs.","commonSituations":"Upstream renamed the archive (e.g. version/platform naming change) so the local asset name no longer appears in the manifest; the SHA256SUMS file uses a different delimiter or includes extra columns; the manifest belongs to a different release than the downloaded file; a proxy returned an HTML error page with status 200.","solutions":["Download SHA256SUMS manually and grep for the asset name to confirm what the manifest actually contains","Compare the local asset filename with upstream's current release assets and update the expected name/version","Verify the manifest corresponds to the same release/version as the downloaded archive","Validate the response body looks like a checksum file (two-column lines) rather than an HTML error page returned with 200","Update the library if upstream changed the manifest format"],"exampleFix":"// before\nreturn \"\", fmt.Errorf(\"SHA256SUMS 中未找到 %s\", asset)\n// after — add context including the manifest source\nreturn \"\", fmt.Errorf(\"SHA256SUMS 中未找到 %s (manifest: %s)\", asset, browserURL(\"SHA256SUMS\"))","handlingStrategy":"validation","validationCode":"body, _ := http.Get(browserURL(\"SHA256SUMS\"))\n// 手动确认清单中包含资产名后再调用\n// grep \"<asset>\" SHA256SUMS","typeGuard":null,"tryCatchPattern":"expected, err := fetchExpectedSHA(asset)\nif err != nil {\n\tif strings.Contains(err.Error(), \"未找到\") {\n\t\t// 清单与资产不匹配：刷新版本或跳过校验并告警\n\t\treturn verifyByRedownload(asset)\n\t}\n\treturn err\n}","preventionTips":["Keep the downloaded archive and the SHA256SUMS from the same release","Confirm the asset naming convention upstream hasn't changed","Sanity-check that the manifest content looks like checksum lines, not an HTML error page","Log the asset name and manifest source together for debugging"],"tags":["checksum","download","integrity","parsing"],"backgroundTag":"checksum-mismatch","analyzedSha":"332d196854a9eac0d2b8c2c0e3d0cc43139d724c","analyzedAt":"2026-09-05T22:22:55.988Z","contentChangedAt":"2026-09-05T22:22:55.988Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}