{"record":{"id":"6e2bbda12c64701a","repo":"zeroclaw-labs/zeroclaw","slug":"checksum-mismatch-for-asset-name-expected-ex","errorCode":null,"errorMessage":"checksum mismatch for '{asset_name}': expected {expected_hex}, got {actual_hex}. The downloaded update may be corrupted or tampered with.","messagePattern":"checksum mismatch for '(.+?)': expected (.+?), got (.+?)\\. The downloaded update may be corrupted or tampered with\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/commands/update.rs","lineNumber":539,"sourceCode":"        .context(\"failed to read SHA256SUMS body\")?;\n    verify_checksum_bytes(bytes, &asset_name, &sums_text)?;\n\n    ::zeroclaw_log::record!(\n        INFO,\n        ::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Note)\n            .with_outcome(::zeroclaw_log::EventOutcome::Success)\n            .with_attrs(::serde_json::json!({\"asset\": asset_name})),\n        \"Update download checksum verified\"\n    );\n    Ok(())\n}\n\nfn verify_checksum_bytes(bytes: &[u8], asset_name: &str, sums_text: &str) -> Result<()> {\n    let expected_hex = expected_sha256_for_asset(sums_text, asset_name)?;\n    let actual_hex = hex::encode(Sha256::digest(bytes));\n\n    if !actual_hex.eq_ignore_ascii_case(expected_hex) {\n        bail!(\n            \"checksum mismatch for '{asset_name}': expected {expected_hex}, got {actual_hex}. \\\n             The downloaded update may be corrupted or tampered with.\"\n        );\n    }\n\n    Ok(())\n}\n\nfn asset_name_from_url(url: &str) -> Option<String> {\n    reqwest::Url::parse(url)\n        .ok()?\n        .path_segments()?\n        .next_back()\n        .filter(|name| !name.is_empty())\n        .map(str::to_string)\n}\n\nfn expected_sha256_for_asset<'a>(sums_text: &'a str, asset_name: &str) -> Result<&'a str> {","sourceCodeStart":521,"sourceCodeEnd":557,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/src/commands/update.rs#L521-L557","documentation":"Error \"checksum mismatch for '{asset_name}': expected {expected_hex}, got {actual_hex}. The downloaded update may be corrupted or tampered with.\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at src/commands/update.rs:539 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete the downloaded artifact and re-run the update to get a fresh copy.","If the mismatch persists, do not install; verify the release checksums from the official source and report a possible tampering issue."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}