{"record":{"id":"f570d11bcfe2148d","repo":"nautechsystems/nautilus_trader","slug":"timeout-waiting-for-account-account-id-to-be-reg-f570d1","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":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/kraken/src/execution/spot.rs","lineNumber":777,"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    #[expect(clippy::too_many_arguments)]\n    fn handle_ws_message(\n        msg: KrakenSpotWsMessage,\n        emitter: &ExecutionEventEmitter,\n        dispatch_state: &Arc<WsDispatchState>,\n        order_request_state: &Arc<OrderRequestState>,\n        instruments: &Arc<AtomicMap<InstrumentId, InstrumentAny>>,\n        order_qty_cache: &Arc<AtomicMap<String, Decimal>>,\n        truncated_id_map: &Arc<AtomicMap<String, ClientOrderId>>,\n        account_id: AccountId,\n        clock: &'static AtomicTime,\n    ) {","sourceCodeStart":759,"sourceCodeEnd":795,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/kraken/src/execution/spot.rs#L759-L795","documentation":"Same family as the Futures variant: the Kraken Spot execution client's `await_account_registered` polls the cache for the generated Spot account after connect and bails with this timeout error if the account update from Kraken never arrives within `timeout_secs`.","triggerScenarios":"`connect` on the Kraken Spot exec client where the private WS/authenticated channel never delivers the balance/account-state that registers the account before the timeout expires.","commonSituations":"Wrong or read-only Spot API keys, Spot account never queried (key without required permissions), network issues, or a very short timeout with a slow connection.","solutions":["Verify Spot API key/secret are correct and have the required permissions (query balances)","Increase the account-registration timeout in the client config","Check logs for WS authentication or subscription errors preceding the timeout","Confirm network connectivity to Kraken Spot WebSocket endpoints"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match connect_result {\n    Err(e) if e.to_string().contains(\"Timeout waiting for account\") => {\n        log::warn!(\"spot account registration timed out; checking key permissions and retrying\");\n        verify_ws_auth()?;\n        connect_with_longer_timeout()?;\n    }\n    r => r?,\n}","preventionTips":["Ensure Spot API keys have balance-query permissions","Raise the registration timeout in slow-network deployments","Validate credentials with a lightweight REST balance call before connect","Check logs for private-channel subscription failures preceding the timeout"],"tags":["rust","kraken-spot","timeout","account-registration","websocket"],"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"}