jdx/mise · error

[settings] in {} is not a table

Error message

[settings] in {} is not a table

What it means

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.

Source

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

        .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 afd2eddd3a)

Solutions

  1. Make [settings] a proper TOML table in the global config
  2. Or remove the malformed settings entry and let mise rewrite it
  3. Re-run the origin set command afterwards
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/system/history/sync/origin.rs:298 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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