{"record":{"id":"a8fe9d5f60226e71","repo":"jdx/mise","slug":"aqua-var-must-be-a-string-got","errorCode":null,"errorMessage":"aqua var `{}` must be a string, got {}","messagePattern":"aqua var `(.+?)` must be a string, got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/aqua.rs","lineNumber":3440,"sourceCode":"/// A failed verification may become valid after resolving a repository transfer.\n/// Only a verified attestation can skip the canonical-repository lookup.\nfn attestation_needs_transfer_retry(\n    result: &std::result::Result<bool, crate::github::sigstore::AttestationError>,\n) -> bool {\n    !matches!(result, Ok(true))\n}\n\nfn toml_value_to_string(value: &toml::Value) -> Option<String> {\n    match value {\n        toml::Value::String(s) => Some(s.clone()),\n        _ => None,\n    }\n}\n\nfn toml_string_var(key: &str, value: &toml::Value) -> Result<String> {\n    match value {\n        toml::Value::String(s) => Ok(s.clone()),\n        value => bail!(\n            \"aqua var `{}` must be a string, got {}\",\n            key,\n            toml_value_kind(value)\n        ),\n    }\n}\n\nfn toml_value_kind(value: &toml::Value) -> &'static str {\n    match value {\n        toml::Value::String(_) => \"string\",\n        toml::Value::Integer(_) | toml::Value::Float(_) => \"number\",\n        toml::Value::Boolean(_) => \"boolean\",\n        toml::Value::Array(_) => \"array\",\n        toml::Value::Table(_) => \"object\",\n        toml::Value::Datetime(_) => \"datetime\",\n    }\n}\n","sourceCodeStart":3422,"sourceCodeEnd":3458,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/backend/aqua.rs#L3422-L3458","documentation":"Aqua packages can define template variables (`vars`) used in registry expressions. toml_string_var enforces that each aqua var used by the embedded plugin is a TOML string. If a var is defined with a non-string TOML type (integer, boolean, table, array), mise returns this error because the templating layer expects string values.","triggerScenarios":"Loading/generating an embedded aqua plugin (aqua.rs:3440, reached via build.rs codegen path) where a package's or registry's var entry in the TOML configuration is declared as a non-string value, e.g. `vars.version = 3` or `vars.enabled = true`.","commonSituations":"Hand-editing an aqua-related config and writing an unquoted number or boolean; a registry migration changed a var's type; TOML auto-typing turns `version = 1.0` into a float.","solutions":["Quote the var value in the TOML config so it is a string: `vars.version = \"3\"`","Check which aqua var key is named in the message and inspect its declared type","Update mise if a recent registry change introduced the non-string var","If authoring embedded plugin options in build.rs input, wrap all values as strings before serialization"],"exampleFix":"# before (mise.toml / embedded plugin options)\n[tools.aqua-vars]\nversion = 3\n\n# after\n[tools.aqua-vars]\nversion = \"3\"","handlingStrategy":"validation","validationCode":"// ensure every aqua var you configure is a string\nfunction assertStringVars(vars) {\n  for (const [k, v] of Object.entries(vars ?? {})) {\n    if (typeof v !== \"string\") throw new Error(`aqua var '${k}' must be a string, got ${typeof v}`);\n  }\n}\nassertStringVars(config[\"aqua-vars\"]);","typeGuard":"function isTomlStringVar(v) {\n  return typeof v === \"string\";\n}","tryCatchPattern":"try {\n  await $`mise install`;\n} catch (e) {\n  const m = String(e).match(/aqua var `(\\S+)` must be a string/);\n  if (m) {\n    // quote the offending var in mise.toml and retry\n    console.error(`Fix mise.toml: quote the value of '${m[1]}'`);\n  } else throw e;\n}","preventionTips":["Always quote aqua var values in TOML so numbers/booleans stay strings","Run `mise fmt` / schema validation on mise.toml before committing","Avoid bare `= 1` or `= true` in aqua-related vars sections"],"tags":["aqua","toml","type-mismatch","config"],"backgroundTag":"config-type-mismatch","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}