zed-industries/zed · error

failed to download update: {:?}

Error message

failed to download update: {:?}

What it means

The main app-update download step: the updater GETs release.url and requires HTTP success before streaming the body to disk; failure surfaces the HTTP status. Progress reporting never starts because the check precedes the copy.

Source

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

                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 bc538def45)

Solutions

  1. Retry the update check to obtain a fresh download URL.
  2. Verify the URL manually with curl -I and compare with the status in the message.
  3. Disable or inspect proxy interception for the download host.
  4. Download the build manually from zed.dev if it keeps failing.
Defensive patterns

Strategy: retry

Validate before calling

// before starting the update
check_free_space(update_dir, expected_size)?; // keep archive + extraction headroom
let fresh_release = fetch_current_release(client, current_version, false, params).await?; // re-resolve instead of reusing a stale URL

Try / catch

match "failed to download update" errors by status: 4xx -> re-resolve the release and retry once; 5xx -> backoff-retry with the same URL.

Prevention

When it happens

Trigger: client.get(&release.url) for the update archive (tar.gz/dmg/exe) returns a non-2xx status - expired pre-signed URL, 404 after assets rotated, CDN or proxy error.

Common situations: Interrupted update sessions reusing stale URLs; CDN hiccups; proxies or firewalls blocking large binary downloads; channel assets unpublished for the current commit.

Related errors


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