{"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/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/replay.rs#L493-L529","documentation":"Before applying any step, apply_steps takes a protective checkpoint of the current state of every path the plan will write or delete. If that checkpoint could not be taken (scope.before() returned None), mise aborts with this error rather than mutating files it could not protect. Nothing was changed.","triggerScenarios":"scope.before() is None in apply_steps — the snapshot/checkpoint capture produced no entry id for the current scope, e.g. the history store or capture walk failed to record a usable 'before' state.","commonSituations":"Corrupt or unwritable history store; live tree capture failing for the target paths; unusual filesystem states that make snapshot capture return no checkpoint.","solutions":["Check the history store directory is writable and not corrupted; run `mise history` listing to verify entries are being recorded.","Retry the rollback/undo command; transient capture failures often clear on retry.","Inspect `MISE_DEBUG=1` output for why the checkpoint capture returned nothing before forcing any manual restore."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"test -w \"$(mise history dir 2>/dev/null || echo ~/.local/share/mise/history)\" && echo writable","typeGuard":null,"tryCatchPattern":"match result { Err(msg) if msg.contains(\"no protective checkpoint\") => { fix_store(); retry(); }, other => other }","preventionTips":["Keep the history store writable by the user running mise.","Verify checkpoints appear in `mise history` during normal work.","Avoid killing mise mid-operation, which can leave unusable scopes."],"tags":["history","checkpoint","snapshot","safety"],"backgroundTag":"checkpoint-unavailable","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}