{"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":"validation","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/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/github_relay.rs#L91-L127","documentation":"During `configure`, the relay computes `Instant::now() + timeout` and `Instant::now() + max_duration`; if either addition overflows the platform's `Instant` representation, the configured durations are unrepresentably large and configuration fails with this error. It protects the relay from scheduling values that would panic on arithmetic later.","triggerScenarios":"Setting `request_timeout` or `max_duration` (or the explicit `max_duration` override argument) to an extremely large duration string, e.g. `9999999999999999999s` or a multi-century duration, such that now+duration overflows `Instant`.","commonSituations":"Users trying to express 'no timeout' with a huge number instead of omitting the setting; unit mistakes like writing milliseconds as nanoseconds; or a misparsed config value like `999999y`.","solutions":["Reduce `request_timeout` and `max_duration` to realistic durations (minutes/hours, not centuries).","Omit or reset the override to the default if you wanted 'effectively unlimited' timeout.","Verify the duration string parses to the intended unit with the library's duration parser first."],"exampleFix":"// before\nMISE_GITHUB_RELAY_MAX_DURATION=99999999999999999999s\n// after\nMISE_GITHUB_RELAY_MAX_DURATION=1h","handlingStrategy":"validation","validationCode":"use std::time::{Duration, Instant};\nfn duration_representable(d: Duration) -> bool {\n    Instant::now().checked_add(d).is_some()\n}","typeGuard":"fn sane_duration(d: Duration) -> Option<Duration> {\n    (d <= Duration::from_secs(30 * 24 * 3600)).then_some(d)\n}","tryCatchPattern":"match relay::configure(&settings, max_override) {\n    Err(e) if e.to_string().contains(\"too large\") => eprintln!(\"reduce timeout/max_duration: {e}\"),\n    Err(e) => return Err(e),\n    Ok(v) => v,\n}","preventionTips":["Cap configured durations at a sane maximum (e.g. 24h) in your own config layer.","Never use gigantic sentinel values for 'no timeout'; omit the setting instead.","Validate duration strings parse and are within bounds before passing them in."],"tags":["config","relay","duration","overflow"],"backgroundTag":"invalid-config-value","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}