{"record":{"id":"772403768a19a533","repo":"nautechsystems/nautilus_trader","slug":"cannot-stop-actor-actor-id-not-found","errorCode":null,"errorMessage":"Cannot stop actor, {actor_id} not found","messagePattern":"Cannot stop actor, (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/system/src/trader.rs","lineNumber":1301,"sourceCode":"    ///\n    /// # Errors\n    ///\n    /// Returns an error if the actor is not registered or cannot be started.\n    pub fn start_actor(&self, actor_id: &ActorId) -> anyhow::Result<()> {\n        if !self.actor_ids.contains(actor_id) {\n            anyhow::bail!(\"Cannot start actor, {actor_id} not found\");\n        }\n        start_component(&actor_id.inner())\n    }\n\n    /// Stops the actor with the given `actor_id`.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the actor is not registered or cannot be stopped.\n    pub fn stop_actor(&self, actor_id: &ActorId) -> anyhow::Result<()> {\n        if !self.actor_ids.contains(actor_id) {\n            anyhow::bail!(\"Cannot stop actor, {actor_id} not found\");\n        }\n        stop_component(&actor_id.inner())\n    }\n\n    /// Removes the actor with the given `actor_id`.\n    ///\n    /// Will stop the actor first if it is currently running. Disposes the actor\n    /// and removes it from the trader's tracking.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the actor is not registered, or if disposal fails. A failed disposal\n    /// keeps the actor registered and tracked, and leaves it `Faulted`; see [`Component::dispose`].\n    /// Calling this again retires the actor.\n    pub fn remove_actor(&mut self, actor_id: &ActorId) -> anyhow::Result<()> {\n        if !self.actor_ids.contains(actor_id) {\n            anyhow::bail!(\"Cannot remove actor, {actor_id} not found\");\n        }","sourceCodeStart":1283,"sourceCodeEnd":1319,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/system/src/trader.rs#L1283-L1319","documentation":"stop_actor was called with an ActorId that is not in the trader's registered actor set; the actor was never added or has already been removed, so there is nothing to stop and the call fails fast.","triggerScenarios":"Thrown at crates/system/src/trader.rs:1301 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Register the actor before attempting to stop it","Verify the actor ID against the trader's registered actor IDs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}