{"record":{"id":"886dd353d0360012","repo":"jdx/mise","slug":"invalid-name-value-invalid-expected-one-of","errorCode":null,"errorMessage":"invalid {name} value {invalid:?}; expected one of: {}","messagePattern":"invalid (.+?) value (.+?); expected one of: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/settings.rs","lineNumber":1969,"sourceCode":"            let trimmed = s.trim();\n            if !trimmed.is_empty() {\n                Some(T::from_str(trimmed))\n            } else {\n                None\n            }\n        })\n        // collect into BTreeSet to remove duplicates\n        .collect::<Result<BTreeSet<_>, _>>()\n        .map(|set| set.into_iter().collect())\n}\n\nfn validate_setting_enum_values<'a>(\n    name: &str,\n    values: impl IntoIterator<Item = &'a str>,\n    allowed: &[&str],\n) -> Result<()> {\n    if let Some(invalid) = values.into_iter().find(|value| !allowed.contains(value)) {\n        bail!(\n            \"invalid {name} value {invalid:?}; expected one of: {}\",\n            allowed.join(\", \")\n        );\n    }\n    Ok(())\n}\n\nfn normalize_tool_names(tools: &BTreeSet<String>) -> BTreeSet<String> {\n    tools\n        .iter()\n        .map(|t| t.trim())\n        .filter(|t| !t.is_empty())\n        .map(str::to_string)\n        .collect()\n}\n\nfn split_default_shell_or_fallback(sa: &str, fallback: &str) -> Result<Vec<String>> {\n    let shell = crate::path::split_shell_command(sa)?;","sourceCodeStart":1951,"sourceCodeEnd":1987,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/config/settings.rs#L1951-L1987","documentation":"This error is thrown when a mise settings value is not one of the allowed enum values for that setting. `validate_setting_enum_values` iterates the provided values and bails with the setting name, the offending value, and the list of allowed values. It is the generic validator used wherever a setting is restricted to a fixed set of strings.","triggerScenarios":"Setting a settings key (e.g. via `mise settings set <key> <value>`, mise.toml `[settings]`, or MISE_<KEY> env vars) to a string that is not in the setting's allowed list; the invalid value is rejected at settings validation time.","commonSituations":"Typos in a settings value ('true' vs 'tru', wrong casing), copying a value valid for one setting into another, upgrading/downgrading mise where the allowed set changed, or writing an env-var-based setting with a wrong literal.","solutions":["Read the 'expected one of: ...' list in the message and set the value to exactly one of those strings","Run `mise settings` (or check docs/settings.toml) to see valid values for the key","Check for typos and case sensitivity in the value","Verify the setting exists in your mise version; the allowed set may differ across releases"],"exampleFix":"// before (mise.toml)\n[settings]\nnode_compile = \"yes\"\n\n// after\n[settings]\nnode_compile = \"true\"","handlingStrategy":"validation","validationCode":"const ALLOWED = [\"true\", \"false\", \"auto\"]; // per setting\nif (!ALLOWED.includes(value)) throw new Error(`invalid ${key} value ${value}; expected one of: ${ALLOWED.join(\", \")}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy allowed values from `mise settings` output instead of typing them","Pin mise version in CI so the allowed value set is stable","Validate settings files in review/CI with `mise settings get <key>`"],"tags":["config","validation","settings"],"backgroundTag":"invalid-enum-value","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"}