{"record":{"id":"dd99dd206db4758d","repo":"jdx/mise","slug":"no-protective-checkpoint-could-be-taken-nothing-w","errorCode":null,"errorMessage":"no protective checkpoint could be taken; nothing was changed","messagePattern":"no protective checkpoint could be taken; nothing was changed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/replay.rs","lineNumber":511,"sourceCode":"        let changed = actionable(&fresh) != actionable(steps);\n        if changed {\n            *steps = fresh.clone();\n            miseprintln!(\"history: the working tree changed since the plan was shown:\");\n            print_plan(steps, exec, tracked)?;\n            if steps\n                .iter()\n                .any(|step| matches!(step.action, Action::Conflict(_)))\n            {\n                bail!(\"the refreshed plan has conflicts; nothing was changed\");\n            }\n            if !exec.yes && !prompt::confirm(\"history: apply the refreshed plan?\")?.is_yes() {\n                bail!(\"declined; nothing was changed\");\n            }\n        }\n        // completeness: every path about to be written or deleted that exists\n        // now must be captured, as it is now, in the protective checkpoint\n        let Some((before_id, _)) = scope.before() else {\n            bail!(\"no protective checkpoint could be taken; nothing was changed\");\n        };\n        let before = store::entry(store, before_id)?;\n        let before_tree = before\n            .checkpoint\n            .tree\n            .snapshot\n            .clone()\n            .ok_or_else(|| eyre::eyre!(\"the protective checkpoint has no content\"))?;\n        let mut missing = vec![];\n        for step in steps.iter().filter(|step| step.action.mutates()) {\n            let Some(current) = repo.restored_object_at(&live, &step.tree_path)? else {\n                continue;\n            };\n            if repo.restored_object_at(&before_tree, &step.tree_path)? != Some(current) {\n                missing.push(step.path.clone());\n            }\n        }\n        if missing.is_empty() {","sourceCodeStart":493,"sourceCodeEnd":529,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/replay.rs#L493-L529","documentation":"Before writing anything, replay takes a protective checkpoint (scope.before()) so the operation can be undone. If no checkpoint id can be produced, mise aborts rather than apply changes with no safety net.","triggerScenarios":"scope.before() returns None during apply_steps — the protective snapshot of the current state could not be created (e.g. snapshotting machinery failed to yield an entry id).","commonSituations":"Snapshot store unavailable or refuses to record the pre-apply state; running in an environment where the protective capture cannot be persisted.","solutions":["Check that the history/checkpoint store is writable and healthy (disk space, permissions)","Run `mise doctor` / inspect history store state for corruption","Retry the command; if persistent, report with MISE_DEBUG=1 output"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// preflight: ensure the history store is writable\nlet store_dir = mise_history_dir();\nassert!(store_dir.metadata()?.permissions().readonly() == false, \"history store must be writable\");","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"no protective checkpoint\") => {\n        eprintln!(\"check history store health (disk space, permissions)\");\n    }\n    other => other?,\n}","preventionTips":["Keep adequate disk space on the volume holding mise's data directory","Avoid interrupting mise while it takes checkpoints","Run `mise doctor` if checkpointing fails repeatedly"],"tags":["history","checkpoint","snapshot","safety-abort"],"backgroundTag":"snapshot-creation-failed","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"}