{"record":{"id":"751c627c1b5f8466","repo":"jdx/mise","slug":"relay-duration-is-too-large","errorCode":null,"errorMessage":"relay duration is too large","messagePattern":"relay duration is too large","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/github_relay.rs","lineNumber":109,"sourceCode":"    let settings = &settings.github_relay;\n    let format = format.unwrap_or(&settings.log_format);\n    if !matches!(format, \"text\" | \"jsonl\") {\n        bail!(\"relay log format must be text or jsonl\");\n    }\n    let timeout = duration::parse_duration(&settings.request_timeout)?;\n    if timeout.is_zero() {\n        bail!(\"relay request timeout must be greater than zero\");\n    }\n    if !(1..=32).contains(&settings.concurrency) {\n        bail!(\"relay concurrency must be between 1 and 32\");\n    }\n    let max_duration = duration::parse_duration(max_duration.unwrap_or(&settings.max_duration))?;\n    if std::time::Instant::now().checked_add(timeout).is_none()\n        || std::time::Instant::now()\n            .checked_add(max_duration)\n            .is_none()\n    {\n        bail!(\"relay duration is too large\");\n    }\n    #[cfg(not(unix))]\n    let _ = max_duration;\n    #[cfg(unix)]\n    let scope = {\n        let mut scope = scope;\n        scope.options = Options {\n            log_requests: !no_log_requests && (log_requests || settings.log_requests),\n            jsonl: format == \"jsonl\",\n            max_duration,\n            request_timeout: timeout,\n            concurrency: settings.concurrency as usize,\n        };\n        scope\n    };\n    Ok(Some(scope))\n}\n","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/github_relay.rs#L91-L127","documentation":"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'.","triggerScenarios":"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).","commonSituations":"Passing 'infinite'-style durations (\"1000y\", huge millisecond counts) to keep the relay alive 'forever'; unit mistakes like entering milliseconds where seconds were meant.","solutions":["Reduce github_relay.max_duration (or the --max-duration flag) to a realistic value, e.g. \"1h\" or \"24h\"","Check the duration units in the config; large numeric values with small units can still overflow","Pick a finite window instead of attempting an unbounded duration"],"exampleFix":"// before\nmycli --github-relay-read-only --github-relay-max-duration 999999999999y\n// after\nmycli --github-relay-read-only --github-relay-max-duration 24h","handlingStrategy":"validation","validationCode":"// Reject absurd durations up front\nlet d = humantime::parse_duration(&settings.github_relay.max_duration)?;\nassert!(d < std::time::Duration::from_secs(10 * 365 * 24 * 3600), \"max_duration unreasonably large\");","typeGuard":null,"tryCatchPattern":"match err {\n    RelayConfigError::DurationTooLarge => eprintln!(\"reduce github_relay.max_duration to a finite value like 24h\"),\n    e => return Err(e),\n}","preventionTips":["Avoid 'infinite' durations; choose bounded windows (hours/days)","Double-check units when converting from ms/s/min","Cap durations at application level before passing to the relay","Test with representative max_duration values on target platforms"],"tags":["github-relay","configuration","duration","overflow"],"backgroundTag":"invalid-duration-format","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}