nautechsystems/nautilus_trader · error

Timeout waiting for account {account_id} to be registered af

Error message

Timeout waiting for account {account_id} to be registered after {timeout_secs}s

What it means

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`.

Source

Thrown at crates/adapters/kraken/src/execution/spot.rs:777

        if self.core.cache().account(&account_id).is_some() {
            log::info!("Account {account_id} registered");
            return Ok(());
        }

        let start = Instant::now();
        let timeout = Duration::from_secs_f64(timeout_secs);
        let interval = Duration::from_millis(10);

        loop {
            tokio::time::sleep(interval).await;

            if self.core.cache().account(&account_id).is_some() {
                log::info!("Account {account_id} registered");
                return Ok(());
            }

            if start.elapsed() >= timeout {
                anyhow::bail!(
                    "Timeout waiting for account {account_id} to be registered after {timeout_secs}s"
                );
            }
        }
    }

    #[expect(clippy::too_many_arguments)]
    fn handle_ws_message(
        msg: KrakenSpotWsMessage,
        emitter: &ExecutionEventEmitter,
        dispatch_state: &Arc<WsDispatchState>,
        order_request_state: &Arc<OrderRequestState>,
        instruments: &Arc<AtomicMap<InstrumentId, InstrumentAny>>,
        order_qty_cache: &Arc<AtomicMap<String, Decimal>>,
        truncated_id_map: &Arc<AtomicMap<String, ClientOrderId>>,
        account_id: AccountId,
        clock: &'static AtomicTime,
    ) {

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Verify Spot API key/secret are correct and have the required permissions (query balances)
  2. Increase the account-registration timeout in the client config
  3. Check logs for WS authentication or subscription errors preceding the timeout
  4. Confirm network connectivity to Kraken Spot WebSocket endpoints
Defensive patterns

Strategy: retry

Try / catch

match connect_result {
    Err(e) if e.to_string().contains("Timeout waiting for account") => {
        log::warn!("spot account registration timed out; checking key permissions and retrying");
        verify_ws_auth()?;
        connect_with_longer_timeout()?;
    }
    r => r?,
}

Prevention

When it happens

Trigger: `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.

Common situations: 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.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/f570d11bcfe2148d. Report an issue: GitHub.