{"record":{"id":"186a1e42e7fbb72e","repo":"nautechsystems/nautilus_trader","slug":"failed-to-stop-one-or-more-trader-components-after","errorCode":null,"errorMessage":"Failed to stop one or more trader components after startup failure: {}","messagePattern":"Failed to stop one or more trader components after startup failure: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/system/src/trader.rs","lineNumber":1161,"sourceCode":"\n            if let Err(e) = self.cleanup_exec_algorithm_subscriptions(exec_algorithm_id) {\n                errors.push(format!(\n                    \"execution algorithm {exec_algorithm_id} subscription cleanup: {e:#}\"\n                ));\n            }\n        }\n\n        for strategy_id in &self.strategy_ids {\n            log::debug!(\"Stopping strategy {strategy_id} after startup failure\");\n            if let Err(e) = Self::stop_component_if_active(strategy_id.inner()) {\n                errors.push(format!(\"strategy {strategy_id}: {e:#}\"));\n            }\n        }\n\n        if errors.is_empty() {\n            Ok(())\n        } else {\n            anyhow::bail!(\n                \"Failed to stop one or more trader components after startup failure: {}\",\n                errors.join(\"; \")\n            )\n        }\n    }\n\n    fn stop_component_if_active(component_id: Ustr) -> anyhow::Result<()> {\n        if !matches!(\n            component_state(&component_id)?,\n            ComponentState::Starting | ComponentState::Running\n        ) {\n            return Ok(());\n        }\n\n        stop_component(&component_id)\n    }\n\n    /// Resets all registered components.","sourceCodeStart":1143,"sourceCodeEnd":1179,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/system/src/trader.rs#L1143-L1179","documentation":"Aggregated teardown report in stop_components_after_start_failure: after a failed startup every component still gets a stop attempt; any per-component stop or subscription-cleanup failures are collected into this joined error.","triggerScenarios":"Thrown at crates/system/src/trader.rs:1161 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the collected per-component errors in the message","Stop or dispose the failing components manually before retrying startup"],"exampleFix":null,"handlingStrategy":"try-catch","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"}