jdx/mise · error
relay concurrency must be between 1 and 32
Error message
relay concurrency must be between 1 and 32
What it means
The GitHub relay's `configure` function validates that the `concurrency` setting for relayed GitHub requests is an integer between 1 and 32 inclusive. This guard prevents spawning an unbounded number of parallel relay connections, which could exhaust connections or trip GitHub rate limits. It is thrown via `bail!` before the relay is started, so configuration fails fast.
Source
Thrown at src/github_relay.rs:101
) -> Result<Option<Scope>> {
let Some(scope) = scope else {
if log_requests || no_log_requests || format.is_some() || max_duration.is_some() {
bail!("relay options require --github-relay-read-only");
}
return Ok(None);
};
let settings = crate::config::Settings::get();
let settings = &settings.github_relay;
let format = format.unwrap_or(&settings.log_format);
if !matches!(format, "text" | "jsonl") {
bail!("relay log format must be text or jsonl");
}
let timeout = duration::parse_duration(&settings.request_timeout)?;
if timeout.is_zero() {
bail!("relay request timeout must be greater than zero");
}
if !(1..=32).contains(&settings.concurrency) {
bail!("relay concurrency must be between 1 and 32");
}
let max_duration = duration::parse_duration(max_duration.unwrap_or(&settings.max_duration))?;
if std::time::Instant::now().checked_add(timeout).is_none()
|| std::time::Instant::now()
.checked_add(max_duration)
.is_none()
{
bail!("relay duration is too large");
}
#[cfg(not(unix))]
let _ = max_duration;
#[cfg(unix)]
let scope = {
let mut scope = scope;
scope.options = Options {
log_requests: !no_log_requests && (log_requests || settings.log_requests),
jsonl: format == "jsonl",
max_duration,View on GitHub (pinned to afd2eddd3a)
Solutions
- Set the relay concurrency setting to an integer in the 1..=32 range (e.g. 16).
- Check the environment variable or config file supplying `concurrency` for typos, empty values, or out-of-range numbers.
- Lower any value copied from a different tool's recommended settings to at most 32.
Example fix
// before MISE_GITHUB_RELAY_CONCURRENCY=64 // after MISE_GITHUB_RELAY_CONCURRENCY=16
Defensive patterns
Strategy: validation
Validate before calling
fn valid_relay_concurrency(c: u32) -> bool { (1..=32).contains(&c) }
if !valid_relay_concurrency(settings.concurrency) { /* fix before calling configure */ } Type guard
fn in_relay_concurrency_range(n: i64) -> Option<u32> {
(1..=32).contains(&n).then(|| n as u32)
} Try / catch
match relay::configure(&settings, None) {
Err(e) if e.to_string().contains("concurrency") => eprintln!("clamp concurrency to 1..=32: {e}"),
Err(e) => return Err(e),
Ok(v) => v,
} Prevention
- Clamp user-supplied concurrency with `.clamp(1, 32)` before building settings.
- Treat the 1..=32 bound as an invariant; document it next to the setting definition.
- Add a unit test that config parsing rejects 0 and 33.
When it happens
Trigger: Calling `configure` (via `npm_command` or `cli_observability_overrides`) with a settings object whose `concurrency` field is 0, negative, or greater than 32 — e.g. `MISE_GITHUB_RELAY_CONCURRENCY=50` or a parsed config value of 0.
Common situations: Users tuning relay throughput set an env var or config key to a large number assuming more is better; a missing/empty value parses to 0; or a default copied from another tool's limit (e.g. 64) exceeds this library's 32 ceiling.
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
- managed path '{}' notifies unconfigured bootstrap service '{
- managed path '{}' notifies unconfigured bootstrap service '{
- cask uses `#{feature}`, which mise's cask shim does not supp
- formula uses `#{feature}`, which mise's source-build shim do
- windows_script_interpreter: {interpreter:?} must be a plain
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/0dce8e7f522999ff.
Report an issue: GitHub.