{"record":{"id":"89c73aed8b1ded35","repo":"zed-industries/zed","slug":"autoupdate-failed-rollback-successful","errorCode":null,"errorMessage":"Autoupdate failed, rollback successful","messagePattern":"Autoupdate failed, rollback successful","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/auto_update_helper/src/updater.rs","lineNumber":438,"sourceCode":"    if last_successful_job\n        .map(|job| job != JOBS.len() - 1)\n        .unwrap_or(true)\n    {\n        let Some(last_successful_job) = last_successful_job else {\n            anyhow::bail!(\"Autoupdate failed, nothing to rollback\");\n        };\n\n        for job in (0..=last_successful_job).rev() {\n            let job = &JOBS[job];\n            if let Err(e) = (job.rollback)(app_dir) {\n                anyhow::bail!(\n                    \"Job rollback failed, the app might be left in an inconsistent state: ({:?})\",\n                    e\n                );\n            }\n        }\n\n        anyhow::bail!(\"Autoupdate failed, rollback successful\");\n    }\n\n    if launch {\n        #[allow(clippy::disallowed_methods, reason = \"doesn't run in the main binary\")]\n        let _child = zed_launch_command(app_dir, launch_arguments)\n            .spawn()\n            .context(\"Failed to launch Zed after update\")?;\n    }\n    log::info!(\"Update completed successfully\");\n    Ok(())\n}\n\n#[cfg(test)]\nmod test {\n    use std::{ffi::OsString, path::Path};\n\n    use super::{perform_update, zed_launch_command};\n","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/auto_update_helper/src/updater.rs#L420-L456","documentation":"The update failed partway, but the rollback of every applied job succeeded — the previous version has been restored. This bail is the updater's terminal report: nothing is broken, but the new version is not installed. The launch step is skipped, so the app is not relaunched by the updater.","triggerScenarios":"Any apply failure after at least one successful, non-delete-critical job, where all rollbacks succeed. E.g., a copy/replace job failed on a locked file but earlier jobs were cleanly reversed.","commonSituations":"A file was locked by a running process mid-update (old version restored); transient disk-full during copy; update downloaded for the wrong architecture/channel and a validation job failed.","solutions":["Close all Zed windows/processes and retry the update — the rollback proves the previous install is intact.","Check the updater log for the apply error that triggered rollback and address it (locks, disk space).","Retry later or use the manual full installer if auto-update keeps failing at the same job."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match run_update(jobs, app_dir).await {\n    Err(err) if err.to_string().contains(\"rollback successful\") => {\n        notify_user(\"update failed; previous version restored. retry later\");\n        Ok(())\n    }\n    result => result,\n}","preventionTips":["Treat 'rollback successful' as a safe, non-broken state — retry the update after closing apps.","Identify the apply job that failed (from the log above this message) and remove its trigger (locks, disk space).","Don't relaunch the app mid-update; let the updater finish or roll back."],"tags":["auto-update","windows","rollback","updater"],"backgroundTag":"update-rollback-failed","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}