jdx/mise · error

cannot verify current files for restoration

Error message

cannot verify current files for restoration: {}

What it means

live_tree captures the current state of tracked files so the restore can be verified against it. If the capture walk had to omit files (permissions, unreadable files, etc.) it produces warnings; since an incomplete live tree would make restore verification unsound, mise aborts instead of proceeding.

Solutions

  1. Fix permissions on the omitted files (chmod/chown, or run under a user that can read them).
  2. Check the warnings list in the message; it names the reason(s) for each omission.
  3. Remove or exclude inaccessible files from the tracked scope, then retry the rollback/undo.
Defensive patterns

Strategy: validation

Validate before calling

find <tracked-paths> ! -readable 2>/dev/null  # unreadable files will be omitted

Prevention

When it happens

Trigger: `repo.capture_tracked` returns captured.omitted non-empty during live_tree, which is called by rollback, undo, and apply_steps — e.g. tracked files unreadable due to permissions or removal mid-walk.

Common situations: Files owned by another user or with restrictive modes inside the tracked tree; files deleted between walk start and read; symlink loops or mount points the walker skips.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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

Appendix: source

Thrown at src/system/history/replay.rs:1396

    }
    if exec.dry_run {
        miseprintln!("history: dry run; nothing was changed");
    }
    Ok(())
}

/// The tracked set as it is on disk right now, as a tree in the repository
/// (objects only; nothing is recorded).
pub(crate) fn live_tree(repo: &HistoryRepo, tracked: &TrackedSet) -> Result<String> {
    let walk = tracked.walk()?;
    let recipients = if walk.files.values().any(|(_, policy)| policy.encrypt) {
        tracked.manifest.recipients.clone()
    } else {
        vec![]
    };
    let captured = repo.capture_tracked(&walk, &recipients, console::user_attended_stderr())?;
    if !captured.omitted.is_empty() {
        bail!(
            "cannot verify current files for restoration: {}",
            captured.warnings.join("; ")
        );
    }
    Ok(captured.tree)
}

/// The newest checkpoint whose captured content for `path` differs from the
/// working tree, if any.
fn newest_differing(
    repo: &HistoryRepo,
    entries: &[Entry],
    live: &str,
    path: &Path,
) -> Result<Option<Entry>> {
    let tree_path = repository_path(repo, live, path)?;
    let current = repo.restored_object_at(live, &tree_path)?;
    for entry in entries.iter().rev() {

View on GitHub (pinned to 533346cc37)