{"record":{"id":"24754e4acf5381fd","repo":"nautechsystems/nautilus_trader","slug":"no-client-registered-with-id-client-id-24754e","errorCode":null,"errorMessage":"No client registered with ID {client_id}","messagePattern":"No client registered with ID (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/execution/src/engine/mod.rs","lineNumber":400,"sourceCode":"\n        self.clients.insert(client_id, adapter);\n        self.default_client_id = Some(client_id);\n        log::debug!(\"Registered default client {client_id}\");\n    }\n\n    /// Marks an already-registered client as the default for fallback routing.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if no client is registered with the given ID, or a default\n    /// client has already been set.\n    pub fn set_default_client(&mut self, client_id: ClientId) -> anyhow::Result<()> {\n        if self.default_client_id.is_some() {\n            anyhow::bail!(\"default client already registered\");\n        }\n\n        if !self.clients.contains_key(&client_id) {\n            anyhow::bail!(\"No client registered with ID {client_id}\");\n        }\n        self.default_client_id = Some(client_id);\n        log::debug!(\"Set client {client_id} as default\");\n        Ok(())\n    }\n\n    #[must_use]\n    /// Returns a reference to the execution client registered with the given ID.\n    pub fn get_client(&self, client_id: &ClientId) -> Option<&dyn ExecutionClient> {\n        self.clients.get(client_id).map(|a| a.client.as_ref())\n    }\n\n    #[must_use]\n    /// Returns a mutable reference to the execution client adapter registered with the given ID.\n    pub fn get_client_adapter_mut(\n        &mut self,\n        client_id: &ClientId,\n    ) -> Option<&mut ExecutionClientAdapter> {","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/execution/src/engine/mod.rs#L382-L418","documentation":"set_default_client validates that the requested client ID exists in the engine's clients map. This error is raised when you try to set a default client that has never been registered via register_client.","triggerScenarios":"Calling ExecutionEngine::set_default_client with a ClientId that is not a key of self.clients — i.e. the client was never registered, or was deregistered beforehand.","commonSituations":"Typo or casing mismatch between the registered client ID and the ID passed to set_default_client; calling set_default_client before register_client in the startup sequence; client was deregistered (which also removes routing entries) and then set as default.","solutions":["Register the client with register_client before calling set_default_client.","Verify the ClientId matches exactly the one used at registration (ClientIds are compared exactly).","Reorder startup code so client registration precedes default assignment.","Check whether the client was deregistered earlier in the flow and re-register it."],"exampleFix":"// before\nengine.set_default_client(\"BINANCE\".into())?; // never registered\n// after\nengine.register_client(binance_client)?;\nengine.set_default_client(binance_client.id().clone())?;","handlingStrategy":"validation","validationCode":"// ensure the client exists before setting it as default\nassert!(engine.get_client_adapter(&client_id).is_some(), \"client {client_id} not registered\");\nengine.set_default_client(client_id)?;","typeGuard":null,"tryCatchPattern":"match engine.set_default_client(id) {\n    Err(e) if e.to_string().contains(\"No client registered\") => register_client_then_retry(),\n    other => other?,\n}","preventionTips":["Always call register_client before set_default_client.","Source ClientIds from the registered adapter's own id() rather than hand-written strings.","Watch for ID casing/typo mismatches between config and registration."],"tags":["execution-engine","client-not-found","registration-order","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"}