{"record":{"id":"c70c87e8143530d9","repo":"nautechsystems/nautilus_trader","slug":"timeout-waiting-for-account-account-id-to-be-reg-c70c87","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/hyperliquid/src/execution.rs","lineNumber":505,"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    fn get_account_address(&self) -> anyhow::Result<String> {\n        self.http_client\n            .get_account_address()\n            .context(\"failed to get account address from HTTP client\")\n    }\n\n    fn spawn_task<F>(&self, description: &'static str, fut: F)\n    where\n        F: std::future::Future<Output = anyhow::Result<()>> + Send + 'static,\n    {\n        let future = async move {\n            if let Err(e) = fut.await {","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/hyperliquid/src/execution.rs#L487-L523","documentation":"After connecting, the execution client waits (polling in a loop) until the account created from the venue data has been registered in the core cache. If the account does not appear within the configured timeout (timeout_secs), the connect routine fails with this error.","triggerScenarios":"Calling connect on the Hyperliquid execution client when the account/entity initialisation from the venue response is slow, delayed, or never completes — cache().account(&account_id) keeps returning None until start.elapsed() exceeds the timeout.","commonSituations":"Slow or degraded Hyperliquid API connectivity delaying initial account state loading; misconfigured credentials causing the account to never be provisioned; very short timeout configured for a high-latency network; venue returning an empty/invalid account state.","solutions":["Increase the connect timeout (timeout_secs) to accommodate network latency.","Check the logs just before this error for errors loading the account from Hyperliquid (auth failures, HTTP errors) — fix the root cause.","Verify API wallet credentials/address are correct so the account state can be loaded.","Check network/proxy connectivity to the Hyperliquid API and retry connect."],"exampleFix":"// before\nlet client = HyperliquidExecutionClient::new(..., /* timeout_secs */ 5)?;\nclient.connect().await?;\n// after\n// give slow networks more time for initial account registration\nlet client = HyperliquidExecutionClient::new(..., /* timeout_secs */ 30)?;\nclient.connect().await?;","handlingStrategy":"try-catch","validationCode":"// ensure credentials and venue address are configured before connect\nassert!(config.api_wallet_address.is_some(), \"Hyperliquid credentials required\");","typeGuard":null,"tryCatchPattern":"match client.connect().await {\n    Ok(()) => {},\n    Err(e) if e.to_string().contains(\"Timeout waiting for account\") => {\n        log::warn!(\"account registration slow; retrying with larger timeout\");\n        // reconnect with increased timeout\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Configure a generous connect timeout for high-latency networks","Verify API credentials before connecting","Watch connect logs for upstream HTTP/auth errors"],"tags":["rust","hyperliquid","timeout","connection","initialization"],"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"}