{"record":{"id":"bd327ec57f8bfe2c","repo":"nautechsystems/nautilus_trader","slug":"exec-connect-timeout","errorCode":null,"errorMessage":"exec-connect timeout","messagePattern":"exec-connect timeout","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/live/src/node/mod.rs","lineNumber":2107,"sourceCode":"    }\n\n    async fn connect_data_phase(&mut self, deadline: dst::time::Instant) -> anyhow::Result<()> {\n        // A zero remaining budget still admits an immediately-ready connect (an\n        // empty/ready client set completes on the first poll); a pending connect\n        // fails closed on that same poll. This keeps a zero `timeout_connection`\n        // - a supported \"do not wait, but allow ready work\" configuration -\n        // working, while still bounding a hung connect.\n        let remaining = deadline.saturating_duration_since(dst::time::Instant::now());\n        dst::time::timeout(remaining, self.kernel.connect_data_clients())\n            .await\n            .map_err(|_| anyhow::anyhow!(\"data-connect timeout\"))\n    }\n\n    async fn connect_exec_clients(&mut self, deadline: dst::time::Instant) -> anyhow::Result<()> {\n        let remaining = deadline.saturating_duration_since(dst::time::Instant::now());\n        dst::time::timeout(remaining, self.kernel.connect_exec_clients())\n            .await\n            .map_err(|_| anyhow::anyhow!(\"exec-connect timeout\"))\n    }\n\n    /// Connects execution clients and checks all engines are connected.\n    ///\n    /// Returns the final connection wait status.\n    /// Must be called after data clients are connected and instrument events drained.\n    async fn connect_exec_phase(\n        &mut self,\n        deadline: dst::time::Instant,\n    ) -> anyhow::Result<EngineConnectionStatus> {\n        self.connect_exec_clients(deadline).await?;\n        Ok(self.await_engines_connected(deadline).await)\n    }\n\n    fn startup_abort_reason(&self) -> Option<&'static str> {\n        if self.handle.should_stop() {\n            Some(\"Stop signal received during startup\")\n        } else if self.kernel.is_shutdown_requested() {","sourceCodeStart":2089,"sourceCodeEnd":2125,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/live/src/node/mod.rs#L2089-L2125","documentation":"connect_exec_clients wraps self.kernel.connect_exec_clients() in a timeout against the shared connection deadline. If execution clients do not all connect before the deadline, this error is returned and start() aborts with \"Execution client connection timed out\". It means the trading venue's execution session never established in the allowed window.","triggerScenarios":"dst::time::timeout(remaining, connect_exec_clients()) elapses in connect_exec_clients (mod.rs:2103-2108); called from start() and connect_exec_phase after data clients are connected.","commonSituations":"Exchange maintenance windows rejecting logins; wrong API keys causing hanging auth; slow venue WebSocket handshake; data connect consumed most of timeout_connection leaving little budget for exec connect.","solutions":["Increase timeout_connection so both data and exec connects fit within the shared deadline.","Verify execution venue credentials and that the venue is not in maintenance; check adapter logs for auth errors.","Confirm the execution WebSocket/REST endpoints are reachable from the host.","If a specific exec adapter consistently hangs, update or replace the adapter / fix its endpoint configuration."],"exampleFix":"// before\ntimeout_connection: Duration::from_secs(20)\n// after\ntimeout_connection: Duration::from_secs(90)","handlingStrategy":"retry","validationCode":"// Confirm exec credentials and venue availability before start\nassert!(!api_key.is_empty() && !api_secret.is_empty());\nTcpStream::connect((exec_ws_host, port)).expect(\"exec websocket unreachable\");","typeGuard":null,"tryCatchPattern":"match node.start().await {\n    Err(e) if e.to_string().contains(\"exec-connect timeout\") => {\n        // check venue status / credentials, raise timeout_connection, retry\n    }\n    other => other?,\n}","preventionTips":["Avoid starting during exchange maintenance windows","Rotate and validate API keys before deployment","Give exec connect its own headroom within timeout_connection","Log and alert on repeated exec connect failures per adapter"],"tags":["network","timeout","trading","startup"],"backgroundTag":"request-timeout","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}