jdx/mise · error

aqua var ` ` must be a string, got

Error message

aqua var `{}` must be a string, got {}

What it means

Aqua registry entries can declare template variables (`var`). mise's helper `toml_string_var` extracts a variable's value from the TOML-encoded registry settings and only accepts string values. This error is thrown when a variable that the package expects as a string is set to a non-string TOML type (number, boolean, array, table).

Solutions

  1. Quote the value in mise.toml so it is a TOML string
  2. Check the aqua registry entry to see the expected type of the var
  3. Remove the variable if it's not required, letting the registry default apply

Example fix

// before (mise.toml)
[tools."aqua:helmify".vars]
chart_version = 3

// after
[tools."aqua:helmify".vars]
chart_version = "3"
Defensive patterns

Strategy: validation

Validate before calling

// ensure all aqua vars in mise.toml are strings
const toml = parse(await fs.readFile('mise.toml', 'utf8'));
for (const [k, v] of Object.entries(toml.tools?.['aqua:x']?.vars ?? {})) {
  if (typeof v !== 'string') throw new Error(`aqua var "${k}" must be a quoted string, got ${typeof v}`);
}

Type guard

function isStringVar(v) { return typeof v === 'string'; }

Try / catch

catch (e) {
  if (e.message.includes('must be a string')) {
    console.error('Quote the value in mise.toml, e.g. chart_version = "3"');
  }
}

Prevention

When it happens

Trigger: Configuring aqua package variables in mise.toml where a `var` the registry template interpolates is given a non-string TOML value, e.g. `version = 3` (integer) or `enabled = true` (boolean) where the template expects a string.

Common situations: Users copying numeric or boolean defaults from the tool's docs into TOML without quoting; passing a table/array where a string flag is expected.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at src/backend/aqua.rs:3521

/// A failed verification may become valid after resolving a repository transfer.
/// Only a verified attestation can skip the canonical-repository lookup.
fn attestation_needs_transfer_retry(
    result: &std::result::Result<bool, crate::github::sigstore::AttestationError>,
) -> bool {
    !matches!(result, Ok(true))
}

fn toml_value_to_string(value: &toml::Value) -> Option<String> {
    match value {
        toml::Value::String(s) => Some(s.clone()),
        _ => None,
    }
}

fn toml_string_var(key: &str, value: &toml::Value) -> Result<String> {
    match value {
        toml::Value::String(s) => Ok(s.clone()),
        value => bail!(
            "aqua var `{}` must be a string, got {}",
            key,
            toml_value_kind(value)
        ),
    }
}

fn toml_value_kind(value: &toml::Value) -> &'static str {
    match value {
        toml::Value::String(_) => "string",
        toml::Value::Integer(_) | toml::Value::Float(_) => "number",
        toml::Value::Boolean(_) => "boolean",
        toml::Value::Array(_) => "array",
        toml::Value::Table(_) => "object",
        toml::Value::Datetime(_) => "datetime",
    }
}

View on GitHub (pinned to 533346cc37)