{"record":{"id":"46510ad98455f290","repo":"nautechsystems/nautilus_trader","slug":"recv-window-ms-must-be-in-the-inclusive-range-1","errorCode":null,"errorMessage":"recv_window_ms must be in the inclusive range 1..=60000, was {recv_window_ms}","messagePattern":"recv_window_ms must be in the inclusive range 1\\.\\.=60000, was (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/config.rs","lineNumber":452,"sourceCode":"        self.instrument_provider.validate(self.product_type)?;\n\n        if self.us {\n            anyhow::ensure!(\n                self.product_type == BinanceProductType::Spot,\n                \"Binance US supports Spot clients only\"\n            );\n            anyhow::ensure!(\n                self.environment == BinanceEnvironment::Live,\n                \"Binance US supports the Live environment only\"\n            );\n        }\n\n        Ok(())\n    }\n}\n\nfn validate_recv_window(recv_window_ms: u64) -> anyhow::Result<()> {\n    anyhow::ensure!(\n        (1..=60_000).contains(&recv_window_ms),\n        \"recv_window_ms must be in the inclusive range 1..=60000, was {recv_window_ms}\"\n    );\n    Ok(())\n}\n\nimpl ClientConfig for BinanceExecutionClientConfig {\n    fn as_any(&self) -> &dyn Any {\n        self\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use rstest::rstest;\n\n    use super::*;\n","sourceCodeStart":434,"sourceCodeEnd":470,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/config.rs#L434-L470","documentation":"recv_window_ms defines the signed-request receive window sent to Binance and must be between 1 and 60000 milliseconds inclusive, matching Binance API limits. validate_recv_window() throws this error for 0 or values above 60 seconds.","triggerScenarios":"Setting recv_window_ms to 0, or to a value > 60000 (e.g. 120000), then calling validate() on the Binance config.","commonSituations":"Confusing milliseconds with seconds (setting 60000 thinking it's 60000s, or setting 5 thinking it's 5s -> out of range intent); env var defaulting to 0 when unset; copying a recv_window value from a different exchange configured in seconds.","solutions":["Set recv_window_ms within 1..=60000, e.g. 5000 (5 seconds).","Check the source value's unit: if configured in seconds, multiply by 1000 before assigning.","Fix env-var/config loading so an unset value does not produce 0."],"exampleFix":"// before\nlet config = BinanceClientConfig { recv_window_ms: 120_000, .. }; // 2 minutes, too large\n// after\nlet config = BinanceClientConfig { recv_window_ms: 5_000, .. }; // 5 seconds","handlingStrategy":"validation","validationCode":"fn recv_window_ok(recv_window_ms: u64) -> bool {\n    (1..=60_000).contains(&recv_window_ms)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp or default recv_window_ms to something like 5_000 ms when loading config.","Convert seconds to milliseconds at the config boundary if your config is expressed in seconds.","Guard against 0 defaults from missing env vars."],"tags":["config","validation","range-check","binance"],"backgroundTag":"value-out-of-range","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}