{"record":{"id":"1528231ed7704870","repo":"jdx/mise","slug":"conflicting-aqua-var-key-use-only-one-spellin","errorCode":null,"errorMessage":"conflicting aqua var `{key}`: use only one spelling","messagePattern":"conflicting aqua var `(.+?)`: use only one spelling","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/aqua.rs","lineNumber":131,"sourceCode":"            }\n\n            let key = if let Some(key) = key.strip_prefix(\"vars.\") {\n                key.to_string()\n            } else {\n                key.clone()\n            };\n            Self::insert_var_option(&mut vars, key, value)?;\n        }\n        Ok(vars)\n    }\n\n    fn insert_var_option<'b>(\n        result: &mut BTreeMap<String, &'b toml::Value>,\n        key: String,\n        value: &'b toml::Value,\n    ) -> Result<()> {\n        if result.contains_key(&key) {\n            bail!(\"conflicting aqua var `{key}`: use only one spelling\");\n        }\n        result.insert(key, value);\n        Ok(())\n    }\n\n    fn insert_nested_var_options<'b>(\n        result: &mut BTreeMap<String, &'b toml::Value>,\n        table: &'b toml::Table,\n    ) -> Result<()> {\n        for (key, value) in table {\n            Self::insert_var_option(result, key.clone(), value)?;\n        }\n        Ok(())\n    }\n}\n\n#[derive(Debug, Clone, PartialEq, Eq)]\nstruct AquaFileLink {","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/aqua.rs#L113-L149","documentation":"Aqua backend configuration allows specifying the same aqua variable under multiple spellings (e.g. different naming forms for the same option). insert_var_option detects that two spellings resolve to the same key and throws rather than silently letting one shadow the other, since the effective value would be ambiguous.","triggerScenarios":"An aqua registry/package config defines a var key that collides with another spelling of the same key when merging var options into the result map (result.contains_key(&key) is true).","commonSituations":"Hand-edited mise/aqua config listing an aqua var twice in different forms; merging a custom aqua registry override on top of a built-in package that already defines the var; copy-pasting package config with both legacy and new key spellings.","solutions":["Search your aqua package/config for duplicate variable definitions and keep only one spelling of each key","If overriding a built-in registry package, remove the var from your override instead of redefining it, or ensure the key names differ","Check recent config edits/diffs for an accidentally duplicated key"],"exampleFix":"# before (mise.toml)\n[tools]\n\"aqua:suzuki-shunsuke/tfcmt\" = { version = \"4\", vars = { wrap = true, wrap = false } }\n# after\n[tools]\n\"aqua:suzuki-shunsuke/tfcmt\" = { version = \"4\", vars = { wrap = true } }","handlingStrategy":"validation","validationCode":"let mut seen = std::collections::HashSet::new();\nfor key in normalized_var_keys(&cfg) {\n    if !seen.insert(key.clone()) {\n        return Err(anyhow!(\"duplicate aqua var `{key}`: use only one spelling\"));\n    }\n}","typeGuard":null,"tryCatchPattern":"match insert_var_option(&mut map, key, value) {\n    Err(e) if e.to_string().contains(\"conflicting aqua var\") => warn_and_skip_or_fail(&key),\n    r => r?,\n}","preventionTips":["Normalize key spellings before merging aqua package configs","When overriding a registry package, diff your vars against the built-in entry","Grep configs for duplicate keys after hand edits (TOML allows silent duplication in some parsers)"],"tags":["aqua","config","duplicate-key"],"backgroundTag":"conflicting-config-options","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"}