jdx/mise · error

{} changed during application; left untouched

Error message

{} changed during application; left untouched

What it means

verify_written() re-observes the directory after permission changes were applied and journaled, comparing against the 'written' snapshot. If the state no longer matches what was just written, something modified it concurrently during application; the step reports failure and leaves the directory untouched rather than fighting the writer.

Source

Thrown at src/system/history/sync/directories.rs:129

    pub(super) fn apply(&mut self) -> Result<()> {
        self.validate()?;
        let pending = journal::begin_changes_with(
            "history",
            "directory permissions",
            [(self.path.clone(), journal::Capture::Shallow)],
        )?;
        if self.before.is_none() {
            crate::file::create_dir_all(&self.path)?;
        }
        set_mode(&self.path, self.desired)?;
        self.written = observe(&self.path)?;
        journal::commit_changes(pending);
        Ok(())
    }

    pub(super) fn verify_written(&self) -> Result<()> {
        if observe(&self.path)? != self.written {
            bail!(
                "{} changed during application; left untouched",
                crate::file::display_path(&self.path)
            );
        }
        Ok(())
    }

    pub(super) fn recover(&self) -> Result<()> {
        if self.written.is_none() {
            return Ok(());
        }
        self.verify_written()?;
        match self.before {
            Some((_, _, mode)) => set_mode(&self.path, mode),
            None => std::fs::remove_dir(&self.path).map_err(Into::into),
        }
    }
}

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Re-run the pull after identifying what modified the directory immediately after apply.
  2. Disable or reconfigure the tool resetting permissions (watcher, security agent) for managed directories.
  3. Retry when no concurrent writer is active.
Defensive patterns

Strategy: try-catch

Validate before calling

let after = observe(&path)?;
if after != written { /* concurrent modification detected */ }

Try / catch

if let Err(e) = apply(&plan) {
    if e.to_string().contains("changed during application") {
        // find and stop the interfering writer, then retry
    }
}

Prevention

When it happens

Trigger: After chmod/journal commit in apply, another process changed the directory's mode or replaced the directory before verify_written ran.

Common situations: File watchers, backup agents, or security tools (e.g. ACL-enforcing daemons) resetting directory permissions; concurrent mise operations.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/48dbf7fe7611e442. Report an issue: GitHub.