{"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/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/replay.rs#L341-L377","documentation":"Restoring (rollback/undo) needs the history store, which is closed when the `history.enabled` setting is false. Both entry points call `ensure_enabled()` first and refuse to run so history state cannot be silently out of sync.","triggerScenarios":"Running `mise dot rollback` or `mise dot undo` while `history.enabled = false` in mise settings (set in settings.toml, config, or via `MISE_HISTORY_ENABLED=false`).","commonSituations":"User (or a config template) disabled history to save disk/speed, then later tries to restore files; corporate config disables history globally; stale settings from a shared dotfiles template.","solutions":["Re-enable history: `mise settings set history.enabled true` (or remove the disabling line from config)","After enabling, create a fresh checkpoint (`mise dot checkpoint`) since no prior state was recorded","If you must restore with history disabled, restore files manually from git/backup instead of via `mise dot undo`"],"exampleFix":"// before\n# settings.toml\n[history]\nenabled = false\n// after\n[history]\nenabled = true","handlingStrategy":"validation","validationCode":"const enabled = await mise.settings.get('history.enabled');\nif (!enabled) throw new Error('enable history.enabled before rollback/undo');","typeGuard":null,"tryCatchPattern":"try {\n  await mise.dot.rollback(req);\n} catch (e) {\n  if (/history is disabled/.test(e.message)) {\n    await mise.settings.set('history.enabled', true);\n  }\n}","preventionTips":["Check `mise settings get history.enabled` before relying on undo/rollback","Avoid disabling history on machines you expect to restore from","Document the history.enabled requirement in team config templates"],"tags":["dotfiles","config","settings"],"backgroundTag":"feature-not-enabled","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"}