{"record":{"id":"f8e32cc5baa6fb46","repo":"Hmbown/CodeWhale","slug":"invalid-sha256-manifest-line-trimmed","errorCode":null,"errorMessage":"invalid SHA256 manifest line {}: {trimmed}","messagePattern":"invalid SHA256 manifest line (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/update.rs","lineNumber":1229,"sourceCode":"\nfn select_checksum_manifest_asset(release: &Release) -> Option<&Asset> {\n    release\n        .assets\n        .iter()\n        .find(|asset| asset.name == CHECKSUM_MANIFEST_ASSET)\n}\n\nfn parse_checksum_manifest(text: &str) -> Result<HashMap<String, String>> {\n    let mut checksums = HashMap::new();\n\n    for (index, line) in text.lines().enumerate() {\n        let trimmed = line.trim();\n        if trimmed.is_empty() {\n            continue;\n        }\n\n        if trimmed.len() < 66 {\n            bail!(\"invalid SHA256 manifest line {}: {trimmed}\", index + 1);\n        }\n\n        let (hash, rest) = trimmed.split_at(64);\n        if !hash.chars().all(|ch| ch.is_ascii_hexdigit())\n            || rest.is_empty()\n            || !rest.chars().next().is_some_and(char::is_whitespace)\n        {\n            bail!(\"invalid SHA256 manifest line {}: {trimmed}\", index + 1);\n        }\n\n        let mut asset_name = rest.trim_start();\n        if let Some(stripped) = asset_name.strip_prefix('*') {\n            asset_name = stripped;\n        }\n        if asset_name.is_empty() {\n            bail!(\"invalid SHA256 manifest line {}: {trimmed}\", index + 1);\n        }\n","sourceCodeStart":1211,"sourceCodeEnd":1247,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/update.rs#L1211-L1247","documentation":"parse_checksum_manifest validates each line of a SHA256SUMS-style manifest. A line is rejected when it is shorter than 66 characters (64-char hash + whitespace + at least a filename start). The error reports the 1-based line number and the offending line text.","triggerScenarios":"select_release_source/probe_release_source -> parse_checksum_manifest on a fetched manifest where a non-empty trimmed line has len < 66; e.g. a truncated hash, a bare filename, or HTML error pages being parsed line-by-line.","commonSituations":"Mirror serving an HTML error page instead of the manifest; release manifest truncated or hand-edited; CRLF/binary corruption producing short garbage lines.","solutions":["Check the manifest URL in a browser/curl — if it returns HTML or a truncated file, the source/mirror is broken; use another source.","Regenerate or republish the checksum manifest for the release.","Retry later if the release is mid-publish."],"exampleFix":"// before (truncated line)\nabc123  codewhale-linux-x86_64\n// after (valid line)\n<64 hex chars>  codewhale-linux-x86_64","handlingStrategy":"validation","validationCode":"fn line_plausibly_sha256(line: &str) -> bool {\n    let t = line.trim(); !t.is_empty() && t.len() >= 66\n} // pre-check manifest lines before parsing","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate that the manifest URL returns text/plain, not an HTML error page","Check manifest integrity (length, encoding) after publish and after mirroring"],"tags":["checksum-manifest","parse-error","manifest","self-update"],"backgroundTag":"schema-validation-failed","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}