zed-industries/zed · error

failed to download update

Error message

failed to download update: {:?}

What it means

download_release issued a GET for the update archive and the response status was not success; the status code is embedded in the message, indicating the update server or CDN rejected the download (e.g. 404 for a yanked asset, 5xx outage) before any bytes were written to the target file.

Solutions

  1. Retry the update download — CDN hiccups and transient 5xx usually resolve on retry
  2. Confirm the release channel/URL still points at a published asset
  3. Free disk space and check permissions if failures persist alongside partial downloads
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/auto_update/src/auto_update.rs:1074 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@916fc2b8cb (2026-08-20). Data as JSON: /api/errors/cb13f86950766e6f. Report an issue: GitHub.

Appendix: source

Thrown at crates/auto_update/src/auto_update.rs:1085

                path,
                error
            );
        }
    }

    Ok(())
}

async fn download_release(
    target_path: &Path,
    release: ReleaseAsset,
    client: Arc<HttpClientWithUrl>,
    mut on_progress: impl FnMut(Option<f32>),
) -> Result<()> {
    let mut target_file = File::create(&target_path).await?;

    let mut response = client.get(&release.url, Default::default(), true).await?;
    anyhow::ensure!(
        response.status().is_success(),
        "failed to download update: {:?}",
        response.status()
    );

    let total_bytes = response
        .headers()
        .get(http_client::http::header::CONTENT_LENGTH)
        .and_then(|value| value.to_str().ok())
        .and_then(|value| value.parse::<u64>().ok())
        .filter(|total_bytes| *total_bytes > 0);

    let mut downloaded_bytes: u64 = 0;
    let mut last_reported_percent: Option<u8> = None;
    let mut buffer = [0u8; 8192];
    let body = response.body_mut();
    loop {
        let bytes_read = body.read(&mut buffer).await?;

View on GitHub (pinned to 916fc2b8cb)