jdx/mise · error

changed before application; nothing was written

Error message

{} changed before application; nothing was written

What it means

Immediately before writing the planned changes, mise re-reads every live file and compares content object and permissions against the values captured when the plan was built. If anything changed in between, nothing is written and the command aborts, naming the path — the plan is stale and applying it could clobber a concurrent edit.

Solutions

  1. Re-run `mise dot pull` (or `mise dot apply`) so a fresh plan is built against the current files.
  2. Check the named path for what changed; if the new content should be kept, `mise dot save <path>` it first.
  3. Avoid editing tracked files while an apply/pull confirmation is pending.

Example fix

before: mise dot apply with the prompt open while an autosave rewrites ~/.zshrc (fails) | after: mise dot save ~/.zshrc && mise dot pull && mise dot apply
Defensive patterns

Strategy: retry

Validate before calling

mise dot status  # and avoid editing files while an apply prompt is open

Try / catch

mise dot apply || { mise dot status; mise dot pull; mise dot apply; }  # rebuild plan and retry once

Prevention

When it happens

Trigger: Between plan creation and application in `mise dot apply`/`mise dot pull`, any ready path's content hash (`live_object`) or mode (`live_permissions`) differs from `step.before` / `step.before_mode`.

Common situations: Editor autosave or a running process rewrote a dotfile while the apply prompt was open; user edited files while reviewing the confirmation; a sync agent touched files between plan and confirmation.

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/ff49ffe0581520b7. Report an issue: GitHub.

Appendix: source

Thrown at src/system/history/sync/apply.rs:619

                        display_path(&step.path)
                    );
                }
            }
            let candidate = heads
                .candidate(repo, tree)?
                .ok_or_else(|| eyre::eyre!("setup branch disappeared"))?;
            audit_incoming_history(repo, &candidate.commit)?;
        }
        // Validate the complete batch again after acquiring the operation
        // lock, before the first write.
        for directory in &directories {
            directory.validate()?;
        }
        for step in &ready {
            if live_object(repo, &step.path)? != step.before
                || live_permissions(&step.path)? != step.before_mode
            {
                bail!(
                    "{} changed before application; nothing was written",
                    display_path(&step.path)
                );
            }
        }
        for directory in &mut directories {
            directory.apply()?;
        }
        for step in &ready {
            // the file may have changed since the plan was made: an edit
            // that landed meanwhile is never overwritten (undo would bring
            // back the planned version, not it)
            if live_object(repo, &step.path)? != step.before
                || live_permissions(&step.path)? != step.before_mode
            {
                bail!(
                    "{} changed while the changes were being applied; nothing more was written. Run `mise dot pull` again",
                    display_path(&step.path)

View on GitHub (pinned to 533346cc37)