{"record":{"id":"d0b64f371b1859e8","repo":"nautechsystems/nautilus_trader","slug":"timeout-waiting-for-account-account-id-to-be-reg-d0b64f","errorCode":null,"errorMessage":"Timeout waiting for account {account_id} to be registered after {timeout_secs}s","messagePattern":"Timeout waiting for account (.+?) to be registered after (.+?)s","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/dydx/src/execution/mod.rs","lineNumber":1045,"sourceCode":"        if self.core.cache().account(&account_id).is_some() {\n            log::info!(\"Account {account_id} registered\");\n            return Ok(());\n        }\n\n        let start = Instant::now();\n        let timeout = Duration::from_secs_f64(timeout_secs);\n        let interval = Duration::from_millis(10);\n\n        loop {\n            tokio::time::sleep(interval).await;\n\n            if self.core.cache().account(&account_id).is_some() {\n                log::info!(\"Account {account_id} registered\");\n                return Ok(());\n            }\n\n            if start.elapsed() >= timeout {\n                anyhow::bail!(\n                    \"Timeout waiting for account {account_id} to be registered after {timeout_secs}s\"\n                );\n            }\n        }\n    }\n}\n\n/// Broadcasts cancel orders with optimal partitioned strategy.\n///\n/// Partitions orders into short-term and long-term/conditional groups:\n/// - Short-term -> single `MsgBatchCancel` via `broadcast_short_term()`\n/// - Long-term/conditional -> batched `MsgCancelOrder` via `broadcast_with_retry()`\n///\n/// At most 2 gRPC calls regardless of order count or mix.\nasync fn broadcast_partitioned_cancels(\n    orders: Vec<DydxCancelOrderRequest>,\n    block_height: u32,\n    tx_manager: Arc<TransactionManager>,","sourceCodeStart":1027,"sourceCodeEnd":1063,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/dydx/src/execution/mod.rs#L1027-L1063","documentation":"After connecting, the dYdX execution client polls the cache until the exchange account (identified by account_id) has been registered, waiting at most timeout_secs. If the account never appears within the timeout it bails, indicating the account-registration flow did not complete.","triggerScenarios":"Calling connect() when the account never gets registered in the cache within the configured timeout — e.g. the dYdX account registration subscription never delivers data or registration fails silently.","commonSituations":"Network latency or a stalled WebSocket preventing registration messages from arriving; wrong account/instrument configuration so the expected account id never appears; exchange outage or auth failure upstream.","solutions":["Increase the registration timeout to accommodate slow networks","Verify credentials and that the account_id matches the connected dYdX wallet","Check logs for earlier WebSocket/subscription errors preventing registration","Test exchange connectivity and retry connect()"],"exampleFix":"// before\nlet client = DydxExecutionClient::new(config_with_timeout_secs(5), ...);\n// after\nlet client = DydxExecutionClient::new(config_with_timeout_secs(30), ...);","handlingStrategy":"try-catch","validationCode":"// before connecting, verify credentials/config\nlet account_id = AccountId::new(&format!(\"DYDX-{wallet_address}\"));\nassert!(!wallet_address.is_empty(), \"wallet address must be configured\");","typeGuard":null,"tryCatchPattern":"match client.connect().await {\n    Ok(()) => {},\n    Err(e) if e.to_string().contains(\"Timeout waiting for account\") => {\n        // check network/credentials, increase timeout, retry once\n        log::error!(\"account registration timed out: {e}\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Set a generous registration timeout for slow networks","Confirm wallet credentials and account_id configuration before connect","Monitor exchange status and WebSocket connectivity; check logs for earlier subscription failures"],"tags":["rust","dydx-exchange","timeout","account-registration"],"backgroundTag":"request-timeout","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}