{"record":{"id":"89d43be0f726976a","repo":"nautechsystems/nautilus_trader","slug":"binance-spot-user-data-stream-is-not-active","errorCode":null,"errorMessage":"Binance Spot user data stream is not active","messagePattern":"Binance Spot user data stream is not active","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/spot/execution.rs","lineNumber":325,"sourceCode":"                .as_ref()\n                .is_some_and(TaskRef::is_active)\n        };\n        let user_data_active = if self.config.us {\n            self.ws_user_data_client\n                .lock()\n                .as_ref()\n                .is_some_and(BinanceSpotWsTradingClient::is_user_data_active)\n        } else {\n            self.ws_trading_client\n                .as_ref()\n                .is_some_and(BinanceSpotWsTradingClient::is_user_data_active)\n        };\n\n        user_data_active && dispatch_running\n    }\n\n    fn ensure_ws_user_data_active(&self) -> anyhow::Result<()> {\n        anyhow::ensure!(\n            self.ws_user_data_active(),\n            \"Binance Spot user data stream is not active\",\n        );\n        Ok(())\n    }\n\n    fn ws_order_transport_active(&self) -> bool {\n        self.config.use_ws_trading && self.ws_trading_client.is_some() && self.ws_user_data_active()\n    }\n\n    fn submit_order_internal(&self, cmd: &SubmitOrder) -> anyhow::Result<()> {\n        let order = self.core.cache().try_order_owned(&cmd.client_order_id)?;\n\n        let event_emitter = self.emitter.clone();\n        let trader_id = self.core.trader_id;\n        let account_id = self.core.account_id;\n        let client_order_id = order.client_order_id();\n        let strategy_id = order.strategy_id();","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/spot/execution.rs#L307-L343","documentation":"Precondition failure in the Binance Spot execution client: order submission requires the private user-data WebSocket stream plus a running dispatch; submitting before connect() established the listen-key stream bails.","triggerScenarios":"Thrown at crates/adapters/binance/src/spot/execution.rs:325 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure connect() has completed and the user-data stream is active before submitting","Check network connectivity and API key permissions for the user data stream"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}