jdx/mise · error

bootstrap compose project

Error message

bootstrap compose project '{name}' wait_timeout must be greater than zero

What it means

Thrown during TOML validation when `wait_timeout = 0` is configured for a bootstrap compose project. A zero timeout would make the wait abort immediately and is almost certainly a mistake, so the library rejects it and requires a strictly positive duration.

Solutions

  1. Set `wait_timeout` to a positive number of seconds, e.g. `wait_timeout = 30`
  2. Remove `wait_timeout` entirely to use the library default

Example fix

# before
[system.compose.myproj]
wait = true
wait_timeout = 0
# after
[system.compose.myproj]
wait = true
wait_timeout = 30
Defensive patterns

Strategy: validation

Validate before calling

if cfg.wait_timeout == Some(0) {
    return Err("wait_timeout must be greater than zero");
}

Prevention

When it happens

Trigger: Setting `wait_timeout = 0` in a `[system.compose.<name>]` block while `wait = true`. Raised from `from_toml_with_origin` at parse time.

Common situations: Placeholder value never filled in; computing the timeout from a variable that defaults to 0; misunderstanding that 0 means 'no timeout' (it does not here).

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/9cf70a4df17c44e2. Report an issue: GitHub.

Appendix: source

Thrown at src/system/compose.rs:338

                config.project_dir.display()
            );
        }
        validate_project_name(config.project_name.as_deref())?;
        validate_values("profile", &config.profiles)?;
        validate_values("service", &config.services)?;
        validate_values("oneshot service", &config.oneshot)?;
        validate_command("command", &config.command)?;
        validate_command("engine_command", &config.engine_command)?;
        if config.state == ComposeState::Absent && !config.services.is_empty() {
            bail!(
                "bootstrap compose project '{name}' services cannot be combined with state = \"absent\" because compose down removes the entire project"
            );
        }
        if !config.wait && config.wait_timeout.is_some() {
            bail!("bootstrap compose project '{name}' wait_timeout requires wait = true");
        }
        if config.wait_timeout == Some(0) {
            bail!("bootstrap compose project '{name}' wait_timeout must be greater than zero");
        }
        if config.state != ComposeState::Absent
            && (config.down_volumes || config.down_images.is_some())
        {
            bail!(
                "bootstrap compose project '{name}' down_volumes and down_images require state = \"absent\""
            );
        }
        if config.state != ComposeState::Running && config.renew_anonymous_volumes {
            bail!(
                "bootstrap compose project '{name}' renew_anonymous_volumes requires state = \"running\""
            );
        }
        let explicit_dependencies = config
            .depends_on
            .iter()
            .map(|dependency| parse_dependency(dependency))
            .collect::<Result<Vec<_>>>()?;

View on GitHub (pinned to 533346cc37)