jdx/mise · error

Check timeout must be greater than zero

Error message

Check timeout must be greater than zero

What it means

Doctor project checks accept an optional `timeout`; mise parses it with parse_duration and defaults to 10 seconds. If the parsed timeout is zero, run_check bails because a zero-duration timeout would either be invalid for the runner or instantly kill the check process.

Solutions

  1. Set the check's `timeout` to a positive duration, e.g. `timeout = "30s"`.
  2. Remove the `timeout` field to use the default 10 seconds.
  3. If the timeout comes from a variable/template, give it a positive default instead of 0.

Example fix

// before
[[doctor.checks]]
name = "test"
run = "npm test"
timeout = "0s"

// after
[[doctor.checks]]
name = "test"
run = "npm test"
timeout = "30s"
Defensive patterns

Strategy: validation

Validate before calling

// verify timeout is a positive duration before invoking doctor
assert!(check.timeout.is_none() || parse_duration(check.timeout.as_ref().unwrap()).unwrap() > Duration::ZERO);

Prevention

When it happens

Trigger: A doctor check with `timeout = "0"`, `timeout = "0s"`, or any value that parse_duration resolves to Duration::zero(), passed into run_check from check.

Common situations: Misunderstanding timeout units (writing 0 expecting 'no limit'); a templated/variable timeout defaulting to 0; copy-pasted config where the timeout was zeroed out.

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/45fd0bb19351b510. Report an issue: GitHub.

Appendix: source

Thrown at src/cli/doctor/project.rs:235

    }
}

async fn run_check(
    check: &DoctorCheck,
    root: &Path,
    environment: &EnvMap,
) -> Result<std::process::Output> {
    if check.run.trim().is_empty() {
        bail!("Check command must not be empty");
    }
    let timeout = check
        .timeout
        .as_deref()
        .map(crate::duration::parse_duration)
        .transpose()?
        .unwrap_or(Duration::from_secs(10));
    if timeout.is_zero() {
        bail!("Check timeout must be greater than zero");
    }
    let mut shell = match &check.shell {
        Some(shell) => crate::path::split_shell_command(shell)?,
        None => Settings::get().default_inline_shell()?,
    };
    Settings::get().maybe_no_profile(&mut shell);
    let Some((program, args)) = shell
        .split_first()
        .filter(|(program, _)| !program.trim().is_empty())
    else {
        bail!("Check shell must not be empty");
    };
    CmdLineRunner::new(program)
        .cmd_body_args(args, &check.run)
        .current_dir(
            check
                .dir
                .as_ref()

View on GitHub (pinned to 533346cc37)