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

After connecting, await_account_registered polls the cache for the client's AccountId, expecting the account state to arrive via the WS/REST account stream within timeout_secs. If the account never appears, connect fails with this timeout, indicating the venue did not report the account (or it was filtered out).

Source

Thrown at crates/adapters/coinbase/src/execution.rs:328

        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"
                );
            }
        }
    }
}

fn unix_nanos_to_utc(ts: UnixNanos) -> jiff::Timestamp {
    ts.to_datetime_utc()
}

#[async_trait(?Send)]
impl ExecutionClient for CoinbaseExecutionClient {
    fn is_connected(&self) -> bool {
        self.core.is_connected()
    }

    fn client_id(&self) -> ClientId {

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Verify API key scopes include account read access for the trading account
  2. Confirm the configured account/environment matches where the key is valid (sandbox vs production)
  3. Increase the account-registration timeout in the client config if the venue is slow
  4. Check logs for incoming account/balance messages; if none, the key or account_id is wrong

Example fix

// before
let config = CoinbaseExecClientConfig { timeout_secs: 5, .. }; // too short

// after
let config = CoinbaseExecClientConfig { timeout_secs: 30, .. };
Defensive patterns

Strategy: retry

Validate before calling

// check scopes/permissions on the key before connect
if !api_key.scopes.contains("view") {
    return Err(anyhow!("API key lacks account read scope"));
}

Try / catch

match client.connect().await {
    Err(e) if e.to_string().contains("Timeout waiting for account") => {
        tokio::time::sleep(Duration::from_secs(5)).await;
        client.connect().await?; // bounded retry
    }
    other => other?,
}

Prevention

When it happens

Trigger: await_account_registered (called from connect) elapses its full timeout without cache().account(&account_id) returning Some — e.g. no account messages received because credentials lack account scope, wrong account configured, or WS connected but no snapshot delivered.

Common situations: API key without read scope on the trading account; connecting to the wrong environment (prod vs sandbox) so the account never publishes; slow network exceeding the fixed timeout; account_type mismatch so the expected account_id differs from the venue's.

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/a60c3bafebed5675. Report an issue: GitHub.