{"record":{"id":"0cc5187bfa23b0a2","repo":"jdx/mise","slug":"invalid-compose-kind-value-value","errorCode":null,"errorMessage":"invalid compose {kind} value '{value}'","messagePattern":"invalid compose (.+?) value '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/compose.rs","lineNumber":1155,"sourceCode":"    if name.is_empty()\n        || !matches!(\n            kind,\n            \"package\" | \"file\" | \"directory\" | \"service\" | \"user\" | \"group\"\n        )\n    {\n        bail!(\n            \"invalid compose dependency '{value}': supported kinds are package, file, directory, service, user, and group\"\n        );\n    }\n    Ok(ResourceId::new(kind, name))\n}\n\nfn validate_values(kind: &str, values: &[String]) -> Result<()> {\n    if let Some(value) = values\n        .iter()\n        .find(|value| value.is_empty() || value.starts_with('-') || value.contains('\\0'))\n    {\n        bail!(\"invalid compose {kind} value '{value}'\");\n    }\n    Ok(())\n}\n\nfn validate_command(kind: &str, command: &[String]) -> Result<()> {\n    if command\n        .iter()\n        .any(|part| part.is_empty() || part.contains('\\0'))\n    {\n        bail!(\"compose {kind} cannot contain empty values or NUL bytes\");\n    }\n    Ok(())\n}\n\nfn dedupe(values: Vec<String>) -> Vec<String> {\n    values\n        .into_iter()\n        .collect::<IndexSet<_>>()","sourceCodeStart":1137,"sourceCodeEnd":1173,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/compose.rs#L1137-L1173","documentation":"Individual values for a compose field (e.g. ports, env entries) must be non-empty, must not start with '-', and must not contain NUL bytes. A value violating any of these is rejected with this error naming the field kind.","triggerScenarios":"Providing an empty string in a values list, a value beginning with a dash (which would be mistaken for a flag), or a value containing a NUL character.","commonSituations":"Trailing commas or blank list items in config, negative numbers or dashed tokens intended as values, corrupted input containing control characters.","solutions":["Remove empty entries from the values list","Quote or restructure values that legitimately start with '-' (e.g. use `key=-value` form) if supported, or drop the leading dash","Sanitize input to strip NUL/control bytes before it reaches the config"],"exampleFix":"// before\nenv = [\"DEBUG\", \"-FLAG\"]\n// after\nenv = [\"DEBUG=1\", \"FLAG=1\"]","handlingStrategy":"validation","validationCode":"fn valid_value(v: &str) -> bool { !v.is_empty() && !v.starts_with('-') && !v.contains('\\0') }\nlet all_ok = values.iter().all(|v| valid_value(v));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid empty list items when generating config programmatically","Do not prefix values with dashes; encode flags as key=value pairs","Strip control characters from user-supplied values"],"tags":["validation","arguments","docker-compose"],"backgroundTag":"invalid-argument-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"}