{"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":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/aqua.rs","lineNumber":3521,"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":3503,"sourceCodeEnd":3539,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/aqua.rs#L3503-L3539","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Quote the value in mise.toml so it is a TOML string","Check the aqua registry entry to see the expected type of the var","Remove the variable if it's not required, letting the registry default apply"],"exampleFix":"// before (mise.toml)\n[tools.\"aqua:helmify\".vars]\nchart_version = 3\n\n// after\n[tools.\"aqua:helmify\".vars]\nchart_version = \"3\"","handlingStrategy":"validation","validationCode":"// ensure all aqua vars in mise.toml are strings\nconst toml = parse(await fs.readFile('mise.toml', 'utf8'));\nfor (const [k, v] of Object.entries(toml.tools?.['aqua:x']?.vars ?? {})) {\n  if (typeof v !== 'string') throw new Error(`aqua var \"${k}\" must be a quoted string, got ${typeof v}`);\n}","typeGuard":"function isStringVar(v) { return typeof v === 'string'; }","tryCatchPattern":"catch (e) {\n  if (e.message.includes('must be a string')) {\n    console.error('Quote the value in mise.toml, e.g. chart_version = \"3\"');\n  }\n}","preventionTips":["Quote every aqua var value in TOML, even numbers and booleans","Check the aqua registry entry's var definitions for expected types","Add a schema/lint check on mise.toml in CI"],"tags":["aqua","config","type-mismatch"],"backgroundTag":"invalid-config-value","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}