{"record":{"id":"cb13f86950766e6f","repo":"zed-industries/zed","slug":"failed-to-download-update","errorCode":null,"errorMessage":"failed to download update: {:?}","messagePattern":"failed to download update: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/auto_update/src/auto_update.rs","lineNumber":1046,"sourceCode":"                path,\n                error\n            );\n        }\n    }\n\n    Ok(())\n}\n\nasync fn download_release(\n    target_path: &Path,\n    release: ReleaseAsset,\n    client: Arc<HttpClientWithUrl>,\n    mut on_progress: impl FnMut(Option<f32>),\n) -> Result<()> {\n    let mut target_file = File::create(&target_path).await?;\n\n    let mut response = client.get(&release.url, Default::default(), true).await?;\n    anyhow::ensure!(\n        response.status().is_success(),\n        \"failed to download update: {:?}\",\n        response.status()\n    );\n\n    let total_bytes = response\n        .headers()\n        .get(http_client::http::header::CONTENT_LENGTH)\n        .and_then(|value| value.to_str().ok())\n        .and_then(|value| value.parse::<u64>().ok())\n        .filter(|total_bytes| *total_bytes > 0);\n\n    let mut downloaded_bytes: u64 = 0;\n    let mut last_reported_percent: Option<u8> = None;\n    let mut buffer = [0u8; 8192];\n    let body = response.body_mut();\n    loop {\n        let bytes_read = body.read(&mut buffer).await?;","sourceCodeStart":1028,"sourceCodeEnd":1064,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/auto_update/src/auto_update.rs#L1028-L1064","documentation":"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.","triggerScenarios":"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.","commonSituations":"Interrupted update sessions reusing stale URLs; CDN hiccups; proxies or firewalls blocking large binary downloads; channel assets unpublished for the current commit.","solutions":["Retry the update check to obtain a fresh download URL.","Verify the URL manually with curl -I and compare with the status in the message.","Disable or inspect proxy interception for the download host.","Download the build manually from zed.dev if it keeps failing."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// before starting the update\ncheck_free_space(update_dir, expected_size)?; // keep archive + extraction headroom\nlet fresh_release = fetch_current_release(client, current_version, false, params).await?; // re-resolve instead of reusing a stale URL","typeGuard":null,"tryCatchPattern":"match \"failed to download update\" errors by status: 4xx -> re-resolve the release and retry once; 5xx -> backoff-retry with the same URL.","preventionTips":["Re-resolve the release before each download attempt","Keep enough free disk for the archive plus extraction","Retry updates after network transitions"],"tags":["network","http","download","auto-update"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}