{"record":{"id":"9b65cecd6aa16e63","repo":"zed-industries/zed","slug":"job-rollback-failed-the-app-might-be-left-in-an-i","errorCode":null,"errorMessage":"Job rollback failed, the app might be left in an inconsistent state: ({:?})","messagePattern":"Job rollback failed, the app might be left in an inconsistent state: \\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/auto_update_helper/src/updater.rs","lineNumber":419,"sourceCode":"                        break 'outer;\n                    }\n                },\n            }\n        }\n    }\n\n    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 _ = std::process::Command::new(app_dir.join(\"Zed.exe\")).spawn();\n    }\n    log::info!(\"Update completed successfully\");\n    Ok(())\n}\n\n#[cfg(test)]","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/auto_update_helper/src/updater.rs#L401-L437","documentation":"After a job failure, the helper rolls completed jobs back in reverse order; if any job's rollback closure itself errors, it bails with this message. The app directory may now be a mix of old and new files - this is the one state where the install can be left inconsistent.","triggerScenarios":"Job N fails, then rolling back job M <= last_successful_job hits an error - typically a file locked by antivirus or Explorer mid-restore, permission denied, or a partially deleted file.","commonSituations":"Endpoint protection interfering during rollback; the old binary restarted while rollback was in flight; disk errors.","solutions":["Repair the install: download the current release from zed.dev and install over the broken copy.","Check for and remove leftover install/old staging directories in the app dir after repairing.","Add antivirus exclusions for the Zed app directory before retrying updates.","Preserve the helper log and report the incident to Zed."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"this is the dangerous case: detect it and immediately offer a repair path - reinstall the current release over the inconsistent directory; never continue running the mixed install or attempt further updates on top of it.","preventionTips":["Keep a known-good installer or download for recovery","Add antivirus exclusions for the app dir","Avoid force-killing the helper mid-rollback"],"tags":["windows","auto-update","rollback","inconsistent-state"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}