jdx/mise · error
invalid compose {kind} value '{value}'
Error message
invalid compose {kind} value '{value}' What it means
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.
Source
Thrown at src/system/compose.rs:1155
if name.is_empty()
|| !matches!(
kind,
"package" | "file" | "directory" | "service" | "user" | "group"
)
{
bail!(
"invalid compose dependency '{value}': supported kinds are package, file, directory, service, user, and group"
);
}
Ok(ResourceId::new(kind, name))
}
fn validate_values(kind: &str, values: &[String]) -> Result<()> {
if let Some(value) = values
.iter()
.find(|value| value.is_empty() || value.starts_with('-') || value.contains('\0'))
{
bail!("invalid compose {kind} value '{value}'");
}
Ok(())
}
fn validate_command(kind: &str, command: &[String]) -> Result<()> {
if command
.iter()
.any(|part| part.is_empty() || part.contains('\0'))
{
bail!("compose {kind} cannot contain empty values or NUL bytes");
}
Ok(())
}
fn dedupe(values: Vec<String>) -> Vec<String> {
values
.into_iter()
.collect::<IndexSet<_>>()View on GitHub (pinned to afd2eddd3a)
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
Example fix
// before values = ["", "-DDEBUG"] // after values = ["DEBUG=1"]
Defensive patterns
Strategy: validation
Validate before calling
fn valid_values(values: &[String]) -> bool {
!values.iter().any(|v| v.is_empty() || v.starts_with('-') || v.contains('\0'))
} Prevention
- Avoid leading dashes in list values
- Check for empty strings after editing lists
- Never embed raw control characters in config values
When it happens
Trigger: 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').
Common situations: Trailing commas or blank TOML entries produce empty strings; users write '-DDEBUG'-style values copied from CLI flags into value lists.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- invalid compose project_name '{name}': use lowercase letters
- invalid compose dependency '{value}': expected '<kind>:<name
- invalid compose dependency '{value}': supported kinds are pa
- compose {kind} cannot contain empty values or NUL bytes
- managed path '{}' notifies unconfigured bootstrap service '{
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/0cc5187bfa23b0a2.
Report an issue: GitHub.