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 tracked state to verify what restoration would change. If the capture reports omitted files (captured.omitted non-empty), mise cannot fully verify the live tree and aborts, listing the capture warnings.

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 afd2eddd3a)

Solutions

  1. Fix permissions/readability on the files named in the warnings (chmod/chown or run as the right user)
  2. Adjust the tracked manifest/ignore configuration so relevant files aren't omitted
  3. Remove or relocate problematic files (e.g. root-owned build artifacts), then re-run

Example fix

// before
$ ls -l .venv/config.bin  # root-owned, unreadable
// after
$ sudo chown -R $USER .venv && mise history rollback <id>
Defensive patterns

Strategy: validation

Validate before calling

// preflight: ensure all tracked files are readable
for path in tracked_paths {
    std::fs::metadata(&path)
        .and_then(|_| std::fs::File::open(&path).map(|_| ()))
        .unwrap_or_else(|e| panic!("unreadable tracked file {}: {}", path, e));
}

Try / catch

match result {
    Err(e) if e.to_string().contains("cannot verify current files") => {
        eprintln!("fix permissions/omissions listed, then retry");
    }
    other => other?,
}

Prevention

When it happens

Trigger: repo.capture_tracked omits files during the pre-restore walk — e.g. unreadable files, permission errors, ignored-but-relevant paths, or files excluded by the tracked manifest.

Common situations: Root-owned or chmod-000 files in the project; files too large or matching ignore rules; running without sufficient permissions (different user, container restrictions).

Understand the failure class

Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.

Related errors


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