astrid-runtime/astrid · error

processes exceeds upper bound

Error message

processes exceeds upper bound ({BACKGROUND_PROCESSES_UPPER_BOUND})

What it means

This error is thrown by `astrid quota set` when the `--processes` value exceeds the compile-time maximum `BACKGROUND_PROCESSES_UPPER_BOUND`. The daemon caps background process counts for a workspace, and a value above the bound would create an unusable quota record, so the CLI rejects it up front with anyhow::bail!.

Solutions

  1. Lower the --processes value to at most BACKGROUND_PROCESSES_UPPER_BOUND
  2. Run `astrid quota set --help` or inspect the constant to learn the exact bound
  3. If a larger limit is genuinely needed, request an increase to BACKGROUND_PROCESSES_UPPER_BOUND upstream rather than bypassing the check

Example fix

// before
astrid quota set --processes 5000
// after
astrid quota set --processes 64
Defensive patterns

Strategy: validation

Validate before calling

const UPPER: u64 = 64; // BACKGROUND_PROCESSES_UPPER_BOUND
if let Some(n) = processes {
    if n > UPPER {
        return Err(format!("--processes must be <= {UPPER}"));
    }
}

Prevention

When it happens

Trigger: Running `astrid quota set --processes <n>` where n > BACKGROUND_PROCESSES_UPPER_BOUND.

Common situations: Typing an oversized value (e.g. copying a machine-level process limit), scripting quota setup with a template variable that resolves to a huge number, or assuming the daemon accepts arbitrary limits.

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 astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/e1ffdc6dc758f658. Report an issue: GitHub.

Appendix: source

Thrown at crates/astrid-cli/src/commands/quota.rs:313

        AdminResponseBody::Quotas(q) => q,
        other => anyhow::bail!("unexpected response from kernel: {other:?}"),
    };
    if let Some(s) = args.memory.as_deref() {
        quotas.max_memory_bytes = parse_bytes(s).context("invalid --memory")?;
    }
    if let Some(s) = args.timeout.as_deref() {
        let d = parse_duration(s).context("invalid --timeout")?;
        quotas.max_timeout_secs = d.as_secs().max(1);
        if quotas.max_timeout_secs > TIMEOUT_SECS_UPPER_BOUND {
            anyhow::bail!("timeout exceeds upper bound ({TIMEOUT_SECS_UPPER_BOUND}s)");
        }
    }
    if let Some(s) = args.storage.as_deref() {
        quotas.max_storage_bytes = parse_bytes(s).context("invalid --storage")?;
    }
    if let Some(n) = args.processes {
        if n > BACKGROUND_PROCESSES_UPPER_BOUND {
            anyhow::bail!("processes exceeds upper bound ({BACKGROUND_PROCESSES_UPPER_BOUND})");
        }
        quotas.max_background_processes = n;
    }
    if let Some(s) = args.ipc_rate.as_deref() {
        quotas.max_ipc_throughput_bytes = parse_bytes(s).context("invalid --ipc-rate")?;
    }
    let body = client
        .request(AdminRequestKind::QuotaSet {
            principal: target.clone(),
            quotas,
        })
        .await?;
    let _ = into_result(body)?;
    println!("Updated quotas for '{target}'.");
    Ok(ExitCode::SUCCESS)
}

// ── byte/duration parsers ──────────────────────────────────────────

View on GitHub (pinned to affd8760f4)