{"record":{"id":"010124fcffc2a8b0","repo":"jdx/mise","slug":"cannot-verify-current-files-for-restoration","errorCode":null,"errorMessage":"cannot verify current files for restoration: {}","messagePattern":"cannot verify current files for restoration: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/replay.rs","lineNumber":1396,"sourceCode":"    }\n    if exec.dry_run {\n        miseprintln!(\"history: dry run; nothing was changed\");\n    }\n    Ok(())\n}\n\n/// The tracked set as it is on disk right now, as a tree in the repository\n/// (objects only; nothing is recorded).\npub(crate) fn live_tree(repo: &HistoryRepo, tracked: &TrackedSet) -> Result<String> {\n    let walk = tracked.walk()?;\n    let recipients = if walk.files.values().any(|(_, policy)| policy.encrypt) {\n        tracked.manifest.recipients.clone()\n    } else {\n        vec![]\n    };\n    let captured = repo.capture_tracked(&walk, &recipients, console::user_attended_stderr())?;\n    if !captured.omitted.is_empty() {\n        bail!(\n            \"cannot verify current files for restoration: {}\",\n            captured.warnings.join(\"; \")\n        );\n    }\n    Ok(captured.tree)\n}\n\n/// The newest checkpoint whose captured content for `path` differs from the\n/// working tree, if any.\nfn newest_differing(\n    repo: &HistoryRepo,\n    entries: &[Entry],\n    live: &str,\n    path: &Path,\n) -> Result<Option<Entry>> {\n    let tree_path = repository_path(repo, live, path)?;\n    let current = repo.restored_object_at(live, &tree_path)?;\n    for entry in entries.iter().rev() {","sourceCodeStart":1378,"sourceCodeEnd":1414,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/replay.rs#L1378-L1414","documentation":"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.","triggerScenarios":"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.","commonSituations":"Root-owned or chmod-000 files in the project; files too large or matching ignore rules; running without sufficient permissions (different user, container restrictions).","solutions":["Fix permissions/readability on the files named in the warnings (chmod/chown or run as the right user)","Adjust the tracked manifest/ignore configuration so relevant files aren't omitted","Remove or relocate problematic files (e.g. root-owned build artifacts), then re-run"],"exampleFix":"// before\n$ ls -l .venv/config.bin  # root-owned, unreadable\n// after\n$ sudo chown -R $USER .venv && mise history rollback <id>","handlingStrategy":"validation","validationCode":"// preflight: ensure all tracked files are readable\nfor path in tracked_paths {\n    std::fs::metadata(&path)\n        .and_then(|_| std::fs::File::open(&path).map(|_| ()))\n        .unwrap_or_else(|e| panic!(\"unreadable tracked file {}: {}\", path, e));\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"cannot verify current files\") => {\n        eprintln!(\"fix permissions/omissions listed, then retry\");\n    }\n    other => other?,\n}","preventionTips":["Keep project files owned/readable by the user running mise","Avoid root-owned artifacts inside tracked directories","Keep tracked manifests consistent with on-disk contents"],"tags":["history","replay","permissions","verification"],"backgroundTag":"permission-denied","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}