jdx/mise · error
[settings] in is not a table
Error message
[settings] in {} is not a table What it means
Thrown by write_config in the history sync origin code when the global mise config file contains a `[settings]` key whose value is not a TOML table (e.g. a string, integer, or array). The code needs to mutate `settings.history.sync` inside that table, so it cannot proceed when the entry is a different TOML type.
Solutions
- Open the global config file shown in the error and change `settings` to a proper TOML table: `[settings]` with key/value lines underneath
- Remove the scalar `settings` line entirely if it was unintended and re-run the command
- Run `mise doctor` to verify the config parses cleanly afterward
Example fix
// before (global config.toml) settings = "readonly" // after [settings] experimental = true
Defensive patterns
Strategy: validation
Validate before calling
let doc = std::fs::read_to_string(&config_path)?;
let parsed: toml::Table = doc.parse()?;
if !matches!(parsed.get("settings"), Some(toml::Value::Table(_))) {
eprintln!("fix [settings] in {} to be a table first", config_path.display());
return Ok(());
} Type guard
fn settings_is_table(doc: &toml::Table) -> bool {
matches!(doc.get("settings"), Some(toml::Value::Table(_)))
} Prevention
- Always edit the global config with proper TOML table syntax ([settings]) rather than scalar assignments
- Run `mise doctor` after hand-editing config files
- Use `mise settings set <key> <value>` instead of manual edits
When it happens
Trigger: Calling `mise dot origin set` (set_inner -> write_config) when the user's global config.toml defines `settings` as a non-table value, such as `settings = "foo"` or `settings = 1`.
Common situations: A hand-edited global config with a typo like `settings="readonly"` instead of `[settings]`; a templating/scripting mistake that wrote a scalar under settings; a corrupted config from a bad merge.
Related errors
- [settings.history] in
- backend must be a string or table
- collection updates require scalar or array values
- command wrapper for must have a non-blank command
- config set requires a TOML config file, but
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/ad81d2d309cb02ce.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/history/sync/origin.rs:363
.or_insert(Item::Table(toml_edit::Table::new()));
let Some(origin) = origin.as_table_mut() else {
bail!(
"[history.origin] in {} is not a table",
display_path(&global)
);
};
origin.set_implicit(false);
origin.insert("url", Item::Value(Value::from(url)));
origin.insert("branch", Item::Value(Value::from(branch)));
let Some(mode) = mode else {
crate::file::write(&global, doc.to_string())?;
return Ok(());
};
let settings = doc
.entry("settings")
.or_insert(Item::Table(toml_edit::Table::new()));
let Some(settings) = settings.as_table_mut() else {
bail!("[settings] in {} is not a table", display_path(&global));
};
settings.set_implicit(true);
let history_settings = settings
.entry("history")
.or_insert(Item::Table(toml_edit::Table::new()));
let Some(history_settings) = history_settings.as_table_mut() else {
bail!(
"[settings.history] in {} is not a table",
display_path(&global)
);
};
history_settings.set_implicit(false);
history_settings.insert("sync", Item::Value(Value::from(mode.as_str())));
crate::file::write(&global, doc.to_string())?;
Ok(())
}
/// Offer enrollment explicitly; connecting origin must not enroll prerequisites.View on GitHub (pinned to 533346cc37)