zed-industries/zed · error
{url} asset got SHA-256 mismatch. Expected: {expected_sha_25
Error message
{url} asset got SHA-256 mismatch. Expected: {expected_sha_256}, Got: {asset_sha_256} What it means
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.
Source
Thrown at crates/http_client/src/github_download.rs:110
.with_context(|| format!("downloading release from {url}"))?;
let binary_path = staging_path.join(binary_file_name);
let mut writer = HashingWriter {
writer: async_fs::File::create(&binary_path)
.await
.with_context(|| format!("creating a file {binary_path:?} for {url}"))?,
hasher: Sha256::new(),
};
futures::io::copy(&mut BufReader::new(response.body_mut()), &mut writer)
.await
.with_context(|| format!("saving binary contents from {url}"))?;
let asset_sha_256 = writer
.finish()
.await
.with_context(|| format!("flushing binary contents for {url}"))?;
if let Some(expected_sha_256) = digest {
anyhow::ensure!(
sha256_matches(&asset_sha_256, expected_sha_256),
"{url} asset got SHA-256 mismatch. Expected: {expected_sha_256}, Got: {asset_sha_256}",
);
}
util::fs::make_file_executable(&binary_path)
.await
.with_context(|| format!("marking {binary_path:?} as executable"))?;
finalize_download(&staging_path, destination_path).await
}
.await;
if let Err(err) = result {
if let Err(err) = async_fs::remove_dir_all(&staging_path).await {
log::warn!("failed to remove staging directory {staging_path:?}: {err:?}");
}
return Err(err);
}View on GitHub (pinned to f4178619ac)
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
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at crates/http_client/src/github_download.rs:110 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/1f262900204e4060.
Report an issue: GitHub.