jdx/mise · error

backends must not be empty

Error message

backends must not be empty

What it means

When parsing a registry tool's TOML table, mise reads the `backends` key, which must be an array of backend definitions, and requires at least one entry. A registry tool with no backends cannot be installed by any means, so the registry source is considered invalid and rejected at parse time.

Source

Thrown at src/registry.rs:418

        for alias in tool.aliases {
            entries.insert((*alias).to_string(), tool.clone());
        }
    }
    Ok(Registry::dynamic(entries, missing_version_order))
}

fn parse_registry_tool(short: &str, value: &toml::Value) -> Result<(RegistryTool, bool)> {
    let table = value
        .as_table()
        .ok_or_else(|| eyre::eyre!("registry tool must be a TOML table"))?;
    let backends = table
        .get("backends")
        .and_then(toml::Value::as_array)
        .ok_or_else(|| eyre::eyre!("backends must be an array"))?
        .iter()
        .map(parse_registry_backend)
        .collect::<Result<Vec<_>>>()?;
    ensure!(!backends.is_empty(), "backends must not be empty");

    let missing_version_order = !table.contains_key("version_order");
    let version_order = match table.get("version_order").and_then(toml::Value::as_str) {
        Some("source") => VersionOrder::Source,
        Some("semver") => VersionOrder::Semver,
        Some(_) => bail!("version_order must be \"source\" or \"semver\""),
        None => VersionOrder::Source,
    };

    ensure!(
        version_order == VersionOrder::Semver || backends.iter().all(|b| b.min_version.is_none()),
        "backend min_version requires version_order = \"semver\""
    );
    let aliases = string_array(table.get("aliases"), "aliases")?;
    let bins = if table.contains_key("bins") {
        string_array(table.get("bins"), "bins")?
    } else {
        BAKED_REGISTRY

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Add at least one backend to the tool's registry TOML, e.g. `[[backends]]` with a valid backend type and source (aqua:/github:/http: etc.).
  2. Check the tool's TOML for `backends = []` and restore the backend entries that were removed or lost in a merge.
  3. Validate the registry TOML locally before publishing (mise's registry test path will surface this error).

Example fix

// before (registry TOML)
[node]
description = "Node.js"
backends = []

// after
[node]
description = "Node.js"

[[backends]]
type = "aqua"
source = "nodejs/node"
Defensive patterns

Strategy: validation

Validate before calling

// quick TOML sanity check in Rust before handing a table to registry parsing
let backends = table.get("backends").and_then(toml::Value::as_array)
    .ok_or("tool TOML missing 'backends' array")?;
if backends.is_empty() { return Err("tool has no backends".into()); }

Prevention

When it happens

Trigger: parse_registry_tool encountering a `[tool]` table where `backends` is an empty array (or `backends` is not an array at all, which raises the adjacent 'backends must be an array' error).

Common situations: A registry contributor adds a new tool stub with `backends = []` as a placeholder, a template removal left the array empty, or a bad merge dropped all backend entries from the tool's TOML file.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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