jdx/mise · error

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

Error message

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

What it means

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.

Source

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

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

Solutions

  1. Fix [settings.history] to be a table in the global config file
  2. Delete the malformed entry and re-run origin set so mise recreates it
  3. Check for hand-edits or tool conflicts that flattened the table
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/system/history/sync/origin.rs:305 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/f6c6b6fe0a817165. Report an issue: GitHub.