{"record":{"id":"5febc4863bb66d66","repo":"jdx/mise","slug":"history-is-disabled-history-enabled-false-not","errorCode":null,"errorMessage":"history is disabled (history.enabled = false); nothing can be restored","messagePattern":"history is disabled \\(history\\.enabled = false\\); nothing can be restored","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/replay.rs","lineNumber":359,"sourceCode":"            dry_run: req.dry_run,\n            yes: req.yes,\n            // the protective checkpoint is authoritative: whatever the\n            // operation replaced, including a type change it forced, is\n            // restored exactly\n            force: true,\n        },\n        &store,\n        &tracked,\n        &entries,\n        live,\n    )\n    .await\n}\n\n/// Restoring needs the store, which `history.enabled = false` closes.\nfn ensure_enabled() -> Result<()> {\n    if !crate::config::Settings::get().history.enabled {\n        bail!(\"history is disabled (history.enabled = false); nothing can be restored\");\n    }\n    Ok(())\n}\n\nstruct Execution {\n    kind: OperationKind,\n    command: String,\n    targets: Vec<Target>,\n    message: String,\n    to: Option<String>,\n    sources: Vec<OperationSource>,\n    undoes: Option<String>,\n    /// Directories to recreate after the plan is applied (an empty directory\n    /// an operation replaced leaves no trace in a snapshot).\n    restore_dirs: BTreeSet<PathBuf>,\n    restore_modes: BTreeMap<String, u32>,\n    dry_run: bool,\n    yes: bool,","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/replay.rs#L341-L377","documentation":"Restoring (rollback/undo) requires the history store, which only exists when the `history.enabled` setting is true. ensure_enabled checks Settings at the start of both entry points and bails when history is disabled, since nothing could have been recorded — and nothing can be restored — with the store closed.","triggerScenarios":"Calling rollback or undo while config has history.enabled = false (set in settings.toml, mise.toml [settings], or MISE_HISTORY_ENABLED=false env).","commonSituations":"Users disabled history for performance/disk reasons and later forget; CI or dotfiles sync templates set history.enabled=false; fresh setups inherit a config that disables history.","solutions":["Enable history: set `history.enabled = true` in settings (mise.toml [settings] or global settings)","Remove an env override like MISE_HISTORY_ENABLED=false","Check `mise settings get history.enabled` to confirm current value"],"exampleFix":"// before\n[settings]\nhistory.enabled = false\n// after\n[settings]\nhistory.enabled = true","handlingStrategy":"validation","validationCode":"const settings = await getSettings();\nif (!settings.history.enabled) {\n  throw new Error(\"history is disabled; enable history.enabled to restore\");\n}","typeGuard":"const historyUsable = (s: Settings): s is Settings & { history: { enabled: true } } =>\n  s.history.enabled === true;","tryCatchPattern":"try {\n  await rollback(req);\n} catch (e) {\n  if (String(e).includes(\"history is disabled\")) {\n    await enableHistory();\n    await rollback(req);\n  } else throw e;\n}","preventionTips":["Check `mise settings get history.enabled` before restore workflows","Avoid MISE_HISTORY_ENABLED=false in shells where you plan to undo","Keep history enabled on machines where you rely on rollback"],"tags":["config","feature-disabled"],"backgroundTag":"feature-not-enabled","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}