jdx/mise · error

relay duration is too large

Error message

relay duration is too large

What it means

configure parses the relay request timeout and max_duration (CLI flag or settings.github_relay.max_duration) and checks that Instant::now() + duration does not overflow. If either addition overflows Instant's internal representation, the durations are unrepresentably large on this platform, and it bails with 'relay duration is too large'.

Solutions

  1. Reduce github_relay.max_duration (or the --max-duration flag) to a realistic value, e.g. "1h" or "24h"
  2. Check the duration units in the config; large numeric values with small units can still overflow
  3. Pick a finite window instead of attempting an unbounded duration

Example fix

// before
mycli --github-relay-read-only --github-relay-max-duration 999999999999y
// after
mycli --github-relay-read-only --github-relay-max-duration 24h
Defensive patterns

Strategy: validation

Validate before calling

// Reject absurd durations up front
let d = humantime::parse_duration(&settings.github_relay.max_duration)?;
assert!(d < std::time::Duration::from_secs(10 * 365 * 24 * 3600), "max_duration unreasonably large");

Try / catch

match err {
    RelayConfigError::DurationTooLarge => eprintln!("reduce github_relay.max_duration to a finite value like 24h"),
    e => return Err(e),
}

Prevention

When it happens

Trigger: configure is called with max_duration set to an astronomically large value (e.g. "99999999999999999999y") or settings.github_relay.max_duration likewise, such that now + duration exceeds Instant's range (also possible for a huge request_timeout in settings).

Common situations: Passing 'infinite'-style durations ("1000y", huge millisecond counts) to keep the relay alive 'forever'; unit mistakes like entering milliseconds where seconds were meant.

Understand the failure class

Background: "invalid duration" / "failed to parse duration": why your timeout, interval, or TTL string is rejected and which formats each library accepts — this error's family across 32 libraries.

Related errors


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

Appendix: source

Thrown at src/github_relay.rs:109

    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,
            request_timeout: timeout,
            concurrency: settings.concurrency as usize,
        };
        scope
    };
    Ok(Some(scope))
}

View on GitHub (pinned to 533346cc37)