{"record":{"id":"ad81d2d309cb02ce","repo":"jdx/mise","slug":"settings-in-is-not-a-table","errorCode":null,"errorMessage":"[settings] in {} is not a table","messagePattern":"\\[settings\\] in (.+?) is not a table","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/origin.rs","lineNumber":298,"sourceCode":"        .or_insert(Item::Table(toml_edit::Table::new()));\n    let Some(origin) = origin.as_table_mut() else {\n        bail!(\n            \"[history.origin] in {} is not a table\",\n            display_path(&global)\n        );\n    };\n    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.","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/sync/origin.rs#L280-L316","documentation":"Config-shape guard in origin write_config: the [settings] entry in the global config file is not a table, blocking insertion of history sync settings. Like the sibling guards, it refuses to overwrite a malformed user config.","triggerScenarios":"Thrown at src/system/history/sync/origin.rs:298 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make [settings] a proper TOML table in the global config","Or remove the malformed settings entry and let mise rewrite it","Re-run the origin set command afterwards"],"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-14T05:17:10.506Z"}