jdx/mise · error

[settings.history] in

Error message

[settings.history] in {} is not a table

What it means

Thrown by write_config when the global config's `[settings]` table exists but its `history` key is not a table. write_config must set `history.sync` under it, so a scalar or array at `settings.history` blocks the update.

Solutions

  1. Edit the global config and replace the scalar `history` value under `[settings]` with a table: `[settings.history]` containing `sync = "..."` or remove it
  2. Remove the invalid `history` key and let `mise dot origin set` create the table itself
  3. Validate the file with a TOML parser or `mise doctor` before retrying

Example fix

// before
[settings]
history = "off"
// after
[settings.history]
sync = "disabled"
Defensive patterns

Strategy: validation

Validate before calling

let doc: toml::Table = std::fs::read_to_string(&config_path)?.parse()?;
let bad = doc.get("settings")
    .and_then(|s| s.get("history"))
    .map(|h| !h.is_table())
    .unwrap_or(false);
if bad { eprintln!("settings.history must be a table in {}"); }

Type guard

fn history_is_table(settings: &toml::Table) -> bool {
    matches!(settings.get("history"), Some(toml::Value::Table(_)))
}

Prevention

When it happens

Trigger: Running `mise dot origin set` when the global config contains e.g. `settings.history = "off"` or `[settings]` `history = 3`.

Common situations: Manually adding a `history` key under `[settings]` as a scalar; a stale or hand-merged config where history sync options were flattened.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/f6c6b6fe0a817165. Report an issue: GitHub.

Appendix: source

Thrown at src/system/history/sync/origin.rs:370

    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.
async fn setup_requirements(tracked: &TrackedSet) -> Result<()> {
    use crate::system::files::FileMode;
    let config = crate::config::Config::get().await?;
    let mut required = std::collections::BTreeSet::new();
    let shared_config = crate::config::global_shared_config_path();
    if shared_config.is_file() {
        required.insert(shared_config);

View on GitHub (pinned to 533346cc37)