{"record":{"id":"f6c6b6fe0a817165","repo":"jdx/mise","slug":"settings-history-in-is-not-a-table","errorCode":null,"errorMessage":"[settings.history] in {} is not a table","messagePattern":"\\[settings\\.history\\] in (.+?) is not a table","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/origin.rs","lineNumber":305,"sourceCode":"    origin.set_implicit(false);\n    origin.insert(\"url\", Item::Value(Value::from(url)));\n    origin.insert(\"branch\", Item::Value(Value::from(branch)));\n    let Some(mode) = mode else {\n        crate::file::write(&global, doc.to_string())?;\n        return Ok(());\n    };\n    let settings = doc\n        .entry(\"settings\")\n        .or_insert(Item::Table(toml_edit::Table::new()));\n    let Some(settings) = settings.as_table_mut() else {\n        bail!(\"[settings] in {} is not a table\", display_path(&global));\n    };\n    settings.set_implicit(true);\n    let history_settings = settings\n        .entry(\"history\")\n        .or_insert(Item::Table(toml_edit::Table::new()));\n    let Some(history_settings) = history_settings.as_table_mut() else {\n        bail!(\n            \"[settings.history] in {} is not a table\",\n            display_path(&global)\n        );\n    };\n    history_settings.set_implicit(false);\n    history_settings.insert(\"sync\", Item::Value(Value::from(mode.as_str())));\n    crate::file::write(&global, doc.to_string())?;\n    Ok(())\n}\n\n/// Offer enrollment explicitly; connecting origin must not enroll prerequisites.\nasync fn setup_requirements(tracked: &TrackedSet) -> Result<()> {\n    use crate::system::files::FileMode;\n    let config = crate::config::Config::get().await?;\n    let mut required = std::collections::BTreeSet::new();\n    let shared_config = crate::config::global_shared_config_path();\n    if shared_config.is_file() {\n        required.insert(shared_config);","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/sync/origin.rs#L287-L323","documentation":"Config-shape guard in origin write_config: the [settings.history] entry exists but is not a table, so history sync mode settings cannot be written. It prevents corrupting a global config whose settings.history value is a scalar or array.","triggerScenarios":"Thrown at src/system/history/sync/origin.rs:305 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix [settings.history] to be a table in the global config file","Delete the malformed entry and re-run origin set so mise recreates it","Check for hand-edits or tool conflicts that flattened the table"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}