{"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/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/compose.rs#L1137-L1173","documentation":"validate_values checks compose settings that accept string lists of a given kind (e.g. env vars/args). Values that are empty, start with '-', or contain NUL bytes are rejected because they would be ambiguous or unsafe when passed through to compose/CLI handling.","triggerScenarios":"A compose list value is an empty string, begins with a dash (looks like a flag), or contains a NUL byte; kind identifies which setting (e.g. 'env' or 'args').","commonSituations":"Trailing commas or blank TOML entries produce empty strings; users write '-DDEBUG'-style values copied from CLI flags into value lists.","solutions":["Remove or fill in empty entries in the list","Rewrite values starting with '-' (use a form without a leading dash, e.g. KEY=value)","Strip control characters such as NUL from the value"],"exampleFix":"// before\nvalues = [\"\", \"-DDEBUG\"]\n// after\nvalues = [\"DEBUG=1\"]","handlingStrategy":"validation","validationCode":"fn valid_values(values: &[String]) -> bool {\n    !values.iter().any(|v| v.is_empty() || v.starts_with('-') || v.contains('\\0'))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid leading dashes in list values","Check for empty strings after editing lists","Never embed raw control characters in config values"],"tags":["validation","config","compose"],"backgroundTag":"invalid-argument-value","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}