{"record":{"id":"1bf6fe698c7a85ee","repo":"jdx/mise","slug":"checkpoint-is-still-running-or-was-interrupted","errorCode":null,"errorMessage":"checkpoint {} is still running or was interrupted; nothing to undo","messagePattern":"checkpoint (.+?) is still running or was interrupted; nothing to undo","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/replay.rs","lineNumber":276,"sourceCode":"        None => entries\n            .iter()\n            .rev()\n            .find(|entry| {\n                entry.checkpoint.operation.as_ref().is_some_and(|op| {\n                    op.status != OperationStatus::Pending\n                        && op.before.is_some()\n                        && !op.affected.is_empty()\n                }) && !undone.contains(&entry.checkpoint.uuid)\n            })\n            .cloned()\n            .ok_or_else(|| eyre::eyre!(\"nothing to undo: no tracked-file operation is left\"))?,\n    };\n    let Some(op) = operation.checkpoint.operation.clone() else {\n        bail!(\"checkpoint {} is not an operation\", operation.id);\n    };\n    // Undo restores tracked files only, never package or service state.\n    if op.status == OperationStatus::Pending {\n        bail!(\n            \"checkpoint {} is still running or was interrupted; nothing to undo\",\n            operation.id\n        );\n    }\n    if op.status == OperationStatus::Failed && !op.affected.is_empty() {\n        info!(\n            \"history: operation {} failed midway; reversing the {} path(s) it changed\",\n            operation.id,\n            op.affected.len()\n        );\n    }\n    let Some(before_uuid) = &op.before else {\n        bail!(\n            \"checkpoint {} has no protective checkpoint to undo from\",\n            operation.id\n        );\n    };\n    let Some(before) = entries","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/replay.rs#L258-L294","documentation":"A checkpoint whose operation status is Pending is either still executing or was interrupted mid-run. Its file state is not final, so undoing from it would restore an inconsistent snapshot; mise refuses to undo such checkpoints.","triggerScenarios":"Running undo against a checkpoint whose OperationStatus is Pending — the operation is concurrently running in another session, or a previous operation crashed and left its checkpoint marked Pending.","commonSituations":"Two terminal sessions where one is mid-install while the other undoes; a crashed operation (killed process, power loss) leaving a stale Pending checkpoint in history.","solutions":["Wait for the running operation to finish, then retry undo","If the operation was interrupted, let the failed-operation path handle it or manually resolve the checkpoint status","Inspect history to confirm the checkpoint's status before undoing"],"exampleFix":"// before\nmise bootstrap dotfiles undo   # checkpoint still Pending\n// after\n# wait for the running operation to complete, then:\nmise bootstrap dotfiles undo","handlingStrategy":"validation","validationCode":"const entry = await getCheckpoint(id);\nif (entry?.checkpoint?.operation?.status === \"pending\") {\n  throw new Error(\"checkpoint still running or interrupted\");\n}","typeGuard":"const isFinished = (op: Operation): op is Operation & { status: Done | Failed } =>\n  op.status !== OperationStatus.Pending;","tryCatchPattern":"try {\n  await undo();\n} catch (e) {\n  if (String(e).includes(\"still running or was interrupted\")) {\n    await waitForOperation(id);\n    await undo();\n  } else throw e;\n}","preventionTips":["Avoid concurrent operations on the same dotfiles store","After a crash, finalize or clean up Pending checkpoints before undo","Poll operation status until terminal before issuing undo"],"tags":["undo","concurrency","checkpoint"],"backgroundTag":"invalid-state-transition","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"}