{"record":{"id":"2322290735fcf808","repo":"DioxusLabs/dioxus","slug":"hash-mismatch-for-url-expected-expected-hash","errorCode":null,"errorMessage":"Hash mismatch for {url}: expected {expected_hash}, got {computed}","messagePattern":"Hash mismatch for (.+?): expected (.+?), got (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/bundler/tools.rs","lineNumber":252,"sourceCode":"    let data = download_bytes(url).await?;\n\n    let computed = match algo {\n        HashAlgo::Sha1 => {\n            use sha1::Digest;\n            let mut hasher = sha1::Sha1::new();\n            hasher.update(&data);\n            format!(\"{:X}\", hasher.finalize())\n        }\n        HashAlgo::Sha256 => {\n            use sha2::Digest;\n            let mut hasher = sha2::Sha256::new();\n            hasher.update(&data);\n            format!(\"{:x}\", hasher.finalize())\n        }\n    };\n\n    if computed.to_uppercase() != expected_hash.to_uppercase() {\n        bail!(\"Hash mismatch for {url}: expected {expected_hash}, got {computed}\");\n    }\n\n    Ok(data)\n}\n\n/// Download bytes from a URL using the async reqwest client.\npub(crate) async fn download_bytes(url: &str) -> Result<Vec<u8>> {\n    let response = reqwest::get(url)\n        .await\n        .with_context(|| format!(\"Failed to download {url}\"))?;\n\n    if !response.status().is_success() {\n        bail!(\"Download failed with status {}: {url}\", response.status());\n    }\n\n    response\n        .bytes()\n        .await","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/bundler/tools.rs#L234-L270","documentation":"A downloaded tool archive failed its integrity check: the computed SHA-1/SHA-256 digest of the received bytes does not match the pinned expected hash for that URL. This usually indicates a corrupted download or a compromised/mirrored source, and the bundler refuses to use the data.","triggerScenarios":"Thrown at packages/cli/src/bundler/tools.rs:252 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The downloaded tool's hash does not match. Re-download; if upstream changed the artifact, update the expected hash in dx."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}