{"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":2111,"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":2093,"sourceCodeEnd":2129,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/config/settings.rs#L2093-L2129","documentation":"`validate_setting_enum_values` validates that settings whose value is restricted to a fixed set of strings actually hold one of the allowed values. If any supplied value is not in the allow-list, mise bails naming the setting, the bad value, and the valid options. This runs during settings validation/load.","triggerScenarios":"Setting any enum-typed setting (e.g. via `mise settings set <name> <value>`, config TOML, or MISE_ env vars) to a string not in the setting's allowed values list.","commonSituations":"Typos in setting values; copying a value from an older mise version where the enum had different members; documentation drift where the valid set changed between releases.","solutions":["Use one of the values listed after 'expected one of:' in the error message.","Run `mise settings` (or check docs/mise.jdx.dev) to see valid values for the setting.","After upgrading mise, re-check settings whose allowed values may have been renamed."],"exampleFix":"# before (mise.toml)\n[settings]\nnode_compile = \"yes\"\n\n# after\n[settings]\nnode_compile = \"true\"  # or whichever value the setting's allow-list defines","handlingStrategy":"validation","validationCode":"# shell: verify a setting value against mise's own output before writing it\nmise settings get <name> 2>/dev/null || mise settings docs <name>  # confirm allowed values","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy allowed values exactly from `mise settings` output or the docs, not from memory.","After upgrading mise, diff your settings against the new schema (`mise settings` lists valid values).","Use `mise settings set <name> <value>` so invalid values are rejected immediately with the allow-list."],"tags":["config","settings","validation","enum"],"backgroundTag":"invalid-enum-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"}