{"record":{"id":"1f262900204e4060","repo":"zed-industries/zed","slug":"url-asset-got-sha-256-mismatch-expected-expec","errorCode":null,"errorMessage":"{url} asset got SHA-256 mismatch. Expected: {expected_sha_256}, Got: {asset_sha_256}","messagePattern":"(.+?) asset got SHA-256 mismatch\\. Expected: (.+?), Got: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/http_client/src/github_download.rs","lineNumber":110,"sourceCode":"            .with_context(|| format!(\"downloading release from {url}\"))?;\n\n        let binary_path = staging_path.join(binary_file_name);\n        let mut writer = HashingWriter {\n            writer: async_fs::File::create(&binary_path)\n                .await\n                .with_context(|| format!(\"creating a file {binary_path:?} for {url}\"))?,\n            hasher: Sha256::new(),\n        };\n        futures::io::copy(&mut BufReader::new(response.body_mut()), &mut writer)\n            .await\n            .with_context(|| format!(\"saving binary contents from {url}\"))?;\n        let asset_sha_256 = writer\n            .finish()\n            .await\n            .with_context(|| format!(\"flushing binary contents for {url}\"))?;\n\n        if let Some(expected_sha_256) = digest {\n            anyhow::ensure!(\n                sha256_matches(&asset_sha_256, expected_sha_256),\n                \"{url} asset got SHA-256 mismatch. Expected: {expected_sha_256}, Got: {asset_sha_256}\",\n            );\n        }\n\n        util::fs::make_file_executable(&binary_path)\n            .await\n            .with_context(|| format!(\"marking {binary_path:?} as executable\"))?;\n        finalize_download(&staging_path, destination_path).await\n    }\n    .await;\n\n    if let Err(err) = result {\n        if let Err(err) = async_fs::remove_dir_all(&staging_path).await {\n            log::warn!(\"failed to remove staging directory {staging_path:?}: {err:?}\");\n        }\n        return Err(err);\n    }","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/http_client/src/github_download.rs#L92-L128","documentation":"Integrity check in download_server_raw_binary: after streaming the release asset to disk through a HashingWriter, the SHA-256 computed over the downloaded bytes does not match the expected digest for that URL. This means the downloaded asset is corrupt, was tampered with, or the expected digest is wrong/outdated; the staging directory is removed so the bad binary is never installed.","triggerScenarios":"Thrown at crates/http_client/src/github_download.rs:110 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the download — transient network corruption is the most common cause","Confirm the expected digest matches the digest published for that release asset","Check for a proxy or mirror that is modifying the asset bytes","If the release was re-published with different content, update the pinned expected digest"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}