{"record":{"id":"6ac1fd4f239cf622","repo":"jdx/mise","slug":"checkpoint-has-no-content-snapshot-6ac1fd","errorCode":null,"errorMessage":"checkpoint {} has no content snapshot","messagePattern":"checkpoint (.+?) has no content snapshot","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/replay.rs","lineNumber":903,"sourceCode":"\n/// The plan for every selected path of every target.\nfn repository_path(repo: &HistoryRepo, tree: &str, path: &Path) -> Result<String> {\n    if let Some(manifest) = super::manifest::Manifest::read(repo, tree)? {\n        let tracked = manifest.tracking()?;\n        if let Some(entry) = tracked.entry_for(&normalize_target(path)) {\n            return entry.tree_path(&normalize_target(path));\n        }\n    }\n    Ok(display_to_tree_path(&path.to_string_lossy()))\n}\n\nfn plan(repo: &HistoryRepo, exec: &Execution, live: &str) -> Result<Vec<Step>> {\n    let force = exec.force;\n    let mut steps = vec![];\n    for target in &exec.targets {\n        let checkpoint = &target.entry.checkpoint;\n        let Some(snapshot) = &checkpoint.tree.snapshot else {\n            bail!(\"checkpoint {} has no content snapshot\", target.entry.id);\n        };\n        for path in &target.paths {\n            let tree_path = repository_path(repo, live, path)?;\n            let mut files: BTreeSet<String> = BTreeSet::new();\n            let mut live_files: BTreeSet<String> = BTreeSet::new();\n            let mut snapshot_files: BTreeSet<String> = BTreeSet::new();\n            // nested repositories in either tree: what is inside one is its\n            // own, never written into or removed by a rollback\n            let mut gitlinks: BTreeSet<String> = BTreeSet::new();\n            for tree in [snapshot.as_str(), live] {\n                let selected = repository_path(repo, tree, path)?;\n                match repo.object_at(tree, &selected)? {\n                    Some((mode, _)) if mode == \"040000\" => {\n                        for entry in repo.ls_tree(&format!(\"{tree}:{selected}\"))? {\n                            let file = format!(\"{tree_path}/{}\", entry.path);\n                            if entry.mode == \"160000\" {\n                                gitlinks.insert(file.clone());\n                            }","sourceCodeStart":885,"sourceCodeEnd":921,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/replay.rs#L885-L921","documentation":"Planning a replay requires the checkpoint's content snapshot (checkpoint.tree.snapshot) to compute file-level diffs. If the referenced checkpoint entry has no snapshot, planning cannot proceed and mise throws this error with the checkpoint id.","triggerScenarios":"`mise history` replay/rollback targets a checkpoint entry whose tree.snapshot is None — plan() iterates exec.targets and bails on the first snapshotless entry.","commonSituations":"Targeting an operation checkpoint that only recorded metadata (e.g. a command that never captured file contents); a truncated or partially-written checkpoint; internal checkpoints that don't snapshot trees.","solutions":["List checkpoints (`mise history`) and target one that includes a content snapshot","Use `refuse_unusable`-style checks: pick a checkpoint with a non-pending status and a snapshot","If the checkpoint should have a snapshot, the store may be corrupted — recreate/re-record the checkpoint"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// select only checkpoints that have a content snapshot\nlet usable: Vec<_> = entries.into_iter()\n    .filter(|e| e.checkpoint.tree.snapshot.is_some())\n    .collect();","typeGuard":"fn has_snapshot(e: &Entry) -> bool {\n    e.checkpoint.tree.snapshot.is_some()\n}","tryCatchPattern":null,"preventionTips":["Only target checkpoints that recorded file contents","Check history listings for snapshot info before replaying","Treat snapshotless checkpoints as metadata-only"],"tags":["history","checkpoint","missing-snapshot","plan"],"backgroundTag":"missing-required-argument","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"}