zed-industries/zed · error · anyhow::Error

Delete operations cannot be rolled back, file: {}

Error message

Delete operations cannot be rolled back, file: {}

What it means

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.

Source

Thrown at crates/auto_update_helper/src/updater.rs:157

                Ok(())
            }),
        }
    }

    pub fn rmdir_nofail(filename: &'static Path) -> Self {
        Job {
            apply: Box::new(move |app_dir| {
                let filename = app_dir.join(filename);
                log::info!("Removing file: {}", filename.display());
                if let Err(e) = std::fs::remove_dir_all(&filename) {
                    log::warn!("Failed to remove directory: {}", e);
                }

                Ok(())
            }),
            rollback: Box::new(move |app_dir| {
                let filename = app_dir.join(filename);
                anyhow::bail!(
                    "Delete operations cannot be rolled back, file: {}",
                    filename.display()
                )
            }),
        }
    }
}

#[cfg(not(test))]
pub(crate) static JOBS: LazyLock<[Job; 22]> = LazyLock::new(|| {
    fn p(value: &str) -> &Path {
        Path::new(value)
    }
    [
        // Move old files
        // Not deleting because installing new files can fail
        Job::mkdir(p("old")),
        Job::move_file(p("Zed.exe"), p("old\\Zed.exe")),

View on GitHub (pinned to f4178619ac)

Solutions

  1. 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.
  2. Check the updater log for which job failed first and why (permissions, disk space, locked files).
  3. Exclude the Zed install directory from antivirus scanning and close apps locking files before retrying.
  4. If the app no longer starts, uninstall and reinstall Zed.
Defensive patterns

Strategy: fallback

Prevention

When it happens

Trigger: 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...').

Common situations: 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.

Related errors


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/5c315e48112c852c. Report an issue: GitHub.