{"record":{"id":"66492cb07901bd81","repo":"nautechsystems/nautilus_trader","slug":"ws-trading-setup-timeout-ms-must-be-greater-than-0","errorCode":null,"errorMessage":"ws_trading_setup_timeout_ms must be greater than 0, was {}","messagePattern":"ws_trading_setup_timeout_ms must be greater than 0, was (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/config.rs","lineNumber":430,"sourceCode":"    transport_backend: TransportBackend,\n});\n\nimpl Default for BinanceExecClientConfig {\n    fn default() -> Self {\n        Self::builder().build()\n    }\n}\n\nimpl BinanceExecClientConfig {\n    /// Validates Binance execution client configuration.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error for invalid receive-window, WS trading setup timeout, provider, or\n    /// Binance US settings.\n    pub fn validate(&self) -> anyhow::Result<()> {\n        validate_recv_window(self.recv_window_ms)?;\n        anyhow::ensure!(\n            self.ws_trading_setup_timeout_ms > 0,\n            \"ws_trading_setup_timeout_ms must be greater than 0, was {}\",\n            self.ws_trading_setup_timeout_ms\n        );\n        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(())","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/config.rs#L412-L448","documentation":"BinanceExecClientConfig.validate requires ws_trading_setup_timeout_ms > 0. This timeout bounds the WebSocket trading setup (key-listen / session establishment) and a zero or negative value would mean either an accidental default (u64 wraps) or a request for no timeout at all, which the client does not support.","triggerScenarios":"BinanceExecClientConfig(ws_trading_setup_timeout_ms=0) or a negative value (which becomes a huge u64 / is rejected), passed to BinanceExecutionClientFactory. The factory calls validate() before constructing the execution client.","commonSituations":"Templates that expose the field but leave it unset where the layer below defaults it to 0; attempting to disable the timeout by passing 0; YAML overrides that delete the value.","solutions":["Set a positive millisecond value, e.g. ws_trading_setup_timeout_ms=10_000 (10 seconds).","If you intended 'no timeout', pick a large but finite value (e.g. 120_000) instead of 0.","Check the field default in the current version and only override when you need a different budget."],"exampleFix":"# before\nBinanceExecClientConfig(ws_trading_setup_timeout_ms=0)\n\n# after\nBinanceExecClientConfig(ws_trading_setup_timeout_ms=10_000)","handlingStrategy":"validation","validationCode":"assert isinstance(config.ws_trading_setup_timeout_ms, int)\nassert config.ws_trading_setup_timeout_ms > 0\nconfig.validate()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set an explicit positive timeout (e.g. 10000 ms).","Treat 0 as a config bug, not as 'no timeout'.","Include the field in config schema checks when loading from files."],"tags":["binance","config","execution","timeout","validation"],"backgroundTag":"config-validation-failed","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}