jdx/mise · error

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

Error message

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

What it means

Config-shape guard in origin write_config: the [history] table exists but its origin entry is not a table ([history.origin] is a scalar/array), so the writer cannot insert url/branch keys. It protects a malformed global config from being silently rewritten.

Source

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

/// Writes the ordinary repository connection.
pub(super) fn write_config(url: &str, branch: &str, mode: Option<SyncMode>) -> Result<()> {
    let global = origin_file()?;
    if let Some(parent) = global.parent() {
        crate::file::create_dir_all(parent)?;
    }
    let mut doc = crate::cli::dotfiles::track::read_document(&global)?;
    let history = doc
        .entry("history")
        .or_insert(Item::Table(toml_edit::Table::new()));
    let Some(history) = history.as_table_mut() else {
        bail!("[history] in {} is not a table", display_path(&global));
    };
    history.set_implicit(true);
    let origin = history
        .entry("origin")
        .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);

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Edit the config so [history.origin] is a table with url and branch keys
  2. Remove the malformed [history.origin] entry and re-run origin set
  3. Validate the TOML structure of the global config file
Defensive patterns

Strategy: validation

When it happens

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