{"record":{"id":"923a599ce8a68430","repo":"nautechsystems/nautilus_trader","slug":"execution-client-is-not-started","errorCode":null,"errorMessage":"Execution client is not started","messagePattern":"Execution client is not started","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":5812,"sourceCode":"        );\n        Ok(())\n    }\n\n    fn batch_cancel_orders(&self, cmd: BatchCancelOrders) -> anyhow::Result<()> {\n        for cancel in cmd.cancels {\n            self.cancel_order(cancel)?;\n        }\n        Ok(())\n    }\n\n    fn query_account(&self, cmd: QueryAccount) -> anyhow::Result<()> {\n        anyhow::ensure!(\n            cmd.account_id == self.core.account_id,\n            \"Query account ID {} does not match client account ID {}\",\n            cmd.account_id,\n            self.core.account_id\n        );\n        anyhow::ensure!(self.core.is_started(), \"Execution client is not started\");\n\n        let balances = self.wallet_balance.lock().as_account_balances()?;\n        self.generate_account_state(\n            balances,\n            vec![],\n            true,\n            get_atomic_clock_realtime().get_time_ns(),\n            None,\n        )\n    }\n\n    fn query_order(&self, cmd: QueryOrder) -> anyhow::Result<()> {\n        log::warn!(\n            \"Order queries are not supported on the blockchain execution client; cannot query {}\",\n            cmd.client_order_id\n        );\n        Ok(())\n    }","sourceCodeStart":5794,"sourceCodeEnd":5830,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L5794-L5830","documentation":"query_account requires the execution client to be in the started state before it reads wallet balances and generates an AccountState. If core.is_started() is false — the client was constructed but never initialized/connected, or was stopped/degraded — the command is rejected. This prevents reporting balances from an uninitialized wallet/signer.","triggerScenarios":"Calling query_account (or emitting a QueryAccount on the bus) before connect()/initialize has completed, after disconnect/stop, or while the client is in a degraded/reconnecting state.","commonSituations":"An actor issues a balance query during startup before the execution client finished connecting; the client dropped its connection and stopped; a query is replayed after a restart; lifecycle wiring starts consumers before the client is fully initialized.","solutions":["Ensure the client is fully started/connected before issuing QueryAccount — wait for the started/initialized lifecycle event","Call the client's connect/start path (which acquires the signer and wallet balances) if it was never started","Reconnect or restart the client if it was stopped, then re-issue the query","Gate downstream actors so they only query after the execution client reports readiness"],"exampleFix":"// before\nclient.query_account(cmd)?; // may run before start\n// after\nif client.core.is_started() {\n    client.query_account(cmd)?;\n} else {\n    client.connect().await?;\n    client.query_account(cmd)?;\n}","handlingStrategy":"type-guard","validationCode":"// gate queries on client readiness\nif !client.is_started() {\n    return Err(anyhow::anyhow!(\"defer query: execution client not started\"));\n}","typeGuard":"fn can_query(client: &ExecutionClient) -> bool {\n    client.core.is_started()\n}","tryCatchPattern":"match client.query_account(cmd) {\n    Err(e) if e.to_string().contains(\"not started\") => {\n        // wait/retry until lifecycle reports started\n        wait_for_started(&client, Duration::from_secs(30)).await?;\n        client.query_account(cmd)\n    }\n    other => other,\n}","preventionTips":["Subscribe to the client's started/initialized lifecycle event before issuing any queries","Order startup: connect the execution client before starting actors that query balances","After disconnect or fault, re-issue queries only after a successful reconnect","Add readiness checks to scheduled balance polling jobs"],"tags":["lifecycle","initialization","state"],"backgroundTag":"invalid-state-transition","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"}