{"record":{"id":"7a01e9dcad42a34f","repo":"nautechsystems/nautilus_trader","slug":"client-client-id-not-found","errorCode":null,"errorMessage":"Client {client_id} not found","messagePattern":"Client (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/execution/src/engine/mod.rs","lineNumber":435,"sourceCode":"        client_id: &ClientId,\n    ) -> Option<&mut ExecutionClientAdapter> {\n        self.clients.get_mut(client_id)\n    }\n\n    /// Generates mass status for the given client.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the client is not found or mass status generation fails.\n    pub async fn generate_mass_status(\n        &mut self,\n        client_id: &ClientId,\n        lookback_mins: Option<u64>,\n    ) -> anyhow::Result<Option<ExecutionMassStatus>> {\n        if let Some(client) = self.get_client_adapter_mut(client_id) {\n            client.generate_mass_status(lookback_mins).await\n        } else {\n            anyhow::bail!(\"Client {client_id} not found\")\n        }\n    }\n\n    /// Registers an external order with the execution client for tracking.\n    ///\n    /// This is called after reconciliation creates an external order, allowing the\n    /// execution client to track it for subsequent events (e.g., cancellations).\n    pub fn register_external_order(\n        &self,\n        client_order_id: ClientOrderId,\n        venue_order_id: VenueOrderId,\n        instrument_id: InstrumentId,\n        strategy_id: StrategyId,\n        ts_init: UnixNanos,\n    ) {\n        let venue = instrument_id.venue;\n        // Prefer the cached origin over venue routing so tracking lands on the\n        // client whose stream materialized the order.","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/execution/src/engine/mod.rs#L417-L453","documentation":"generate_mass_status resolves the execution client adapter by client_id via get_client_adapter_mut; if no adapter with that ID is registered in the engine, it bails with this error instead of returning a status.","triggerScenarios":"Calling ExecutionEngine::generate_mass_status(client_id, lookback_mins) with a client_id that has no registered adapter — never registered, deregistered, or a typo/mismatched ID.","commonSituations":"Requesting a mass status report during reconciliation for a client that failed to register at startup; using an ID from config that differs from the registered adapter's client_id; calling after deregister_client removed the client.","solutions":["Verify the client is registered (register_client succeeded) before requesting mass status.","Use the exact client_id the adapter was registered with; log/enumerate registered clients to confirm.","Re-register the client if it was deregistered, then retry generate_mass_status.","Handle the error path in reconciliation so a missing client is skipped/logged rather than aborting the whole reconciliation."],"exampleFix":"// before\nlet status = engine.generate_mass_status(&client_id, None).await?; // bails if unknown\n// after\nif engine.get_client_adapter(&client_id).is_some() {\n    let status = engine.generate_mass_status(&client_id, None).await?;\n}","handlingStrategy":"validation","validationCode":"if engine.get_client_adapter(client_id).is_some() {\n    let status = engine.generate_mass_status(client_id, lookback_mins).await?;\n}","typeGuard":null,"tryCatchPattern":"match engine.generate_mass_status(client_id, lookback).await {\n    Err(e) if e.to_string().contains(\"not found\") => log::warn!(\"client {client_id} unavailable for mass status, skipping\"),\n    other => other?,\n}","preventionTips":["Only request mass status for clients whose register_client call succeeded.","Keep the ClientId used for reports identical to the one used at registration.","Handle client absence gracefully in reconciliation loops rather than failing the whole reconciliation."],"tags":["execution-engine","client-not-found","mass-status","rust"],"backgroundTag":"resource-not-found","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"}