{"record":{"id":"5c315e48112c852c","repo":"zed-industries/zed","slug":"delete-operations-cannot-be-rolled-back-file","errorCode":null,"errorMessage":"Delete operations cannot be rolled back, file: {}","messagePattern":"Delete operations cannot be rolled back, file: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/auto_update_helper/src/updater.rs","lineNumber":157,"sourceCode":"                Ok(())\n            }),\n        }\n    }\n\n    pub fn rmdir_nofail(filename: &'static Path) -> Self {\n        Job {\n            apply: Box::new(move |app_dir| {\n                let filename = app_dir.join(filename);\n                log::info!(\"Removing file: {}\", filename.display());\n                if let Err(e) = std::fs::remove_dir_all(&filename) {\n                    log::warn!(\"Failed to remove directory: {}\", e);\n                }\n\n                Ok(())\n            }),\n            rollback: Box::new(move |app_dir| {\n                let filename = app_dir.join(filename);\n                anyhow::bail!(\n                    \"Delete operations cannot be rolled back, file: {}\",\n                    filename.display()\n                )\n            }),\n        }\n    }\n}\n\n#[cfg(not(test))]\npub(crate) static JOBS: LazyLock<[Job; 22]> = LazyLock::new(|| {\n    fn p(value: &str) -> &Path {\n        Path::new(value)\n    }\n    [\n        // Move old files\n        // Not deleting because installing new files can fail\n        Job::mkdir(p(\"old\")),\n        Job::move_file(p(\"Zed.exe\"), p(\"old\\\\Zed.exe\")),","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/auto_update_helper/src/updater.rs#L139-L175","documentation":"Each step of Zed's auto-update is a `Job` with an `apply` and a `rollback` closure. Delete jobs remove files/directories and, because deleted files cannot be restored, their rollback closure always bails with this message naming the deleted path. Hitting it means the update failed partway and the rollback walked back to a delete step it cannot undo.","triggerScenarios":"The updater's apply loop fails on some job after a delete job already succeeded, so the rollback loop `(0..=last_successful_job).rev()` reaches the delete job and invokes its rollback, which always errors. In practice this surfaces wrapped by error 149 ('Job rollback failed...').","commonSituations":"Windows auto-update interrupted mid-sequence: file locks by antivirus/Explorer, disk full, process killed during apply. The delete step succeeded, a later step failed, and rollback cannot restore what was deleted.","solutions":["Re-run the auto-update (or download the full installer and install over the existing app) — a fresh complete install is the only way to restore consistency.","Check the updater log for which job failed first and why (permissions, disk space, locked files).","Exclude the Zed install directory from antivirus scanning and close apps locking files before retrying.","If the app no longer starts, uninstall and reinstall Zed."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never rely on rollback for delete steps — order update jobs so deletions happen only after all error-prone steps succeed.","Ensure disk space and close/AV-exclude the app directory before updates so the apply loop never fails mid-sequence.","After any failed auto-update, verify install consistency and prefer a full reinstall."],"tags":["auto-update","windows","rollback","updater"],"backgroundTag":"update-rollback-unsupported","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}