{"record":{"id":"184b9725a06e1afb","repo":"nautechsystems/nautilus_trader","slug":"failed-to-start-execution-algorithm-exec-algorith","errorCode":null,"errorMessage":"Failed to start execution algorithm {exec_algorithm_id}: {start_err:#}; failed to roll back subscriptions: {cleanup_err:#}","messagePattern":"Failed to start execution algorithm (.+?): (.+?); failed to roll back subscriptions: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/system/src/trader.rs","lineNumber":1008,"sourceCode":"            return Ok(());\n        }\n\n        start_component(&component_id)\n    }\n\n    fn start_exec_algorithm_if_not_running(\n        &mut self,\n        exec_algorithm_id: ExecAlgorithmId,\n    ) -> anyhow::Result<bool> {\n        if component_state(&exec_algorithm_id.inner())? == ComponentState::Running {\n            return Ok(false);\n        }\n\n        self.restore_exec_algorithm_subscriptions(exec_algorithm_id)?;\n        if let Err(start_err) = start_component(&exec_algorithm_id.inner()) {\n            return match self.cleanup_exec_algorithm_subscriptions(exec_algorithm_id) {\n                Ok(()) => Err(start_err),\n                Err(cleanup_err) => anyhow::bail!(\n                    \"Failed to start execution algorithm {exec_algorithm_id}: {start_err:#}; \\\n                     failed to roll back subscriptions: {cleanup_err:#}\"\n                ),\n            };\n        }\n\n        Ok(true)\n    }\n\n    fn restore_exec_algorithm_subscriptions(\n        &mut self,\n        exec_algorithm_id: ExecAlgorithmId,\n    ) -> anyhow::Result<()> {\n        if let Some(restore_fn) = self.exec_algorithm_restore_fns.get_mut(&exec_algorithm_id) {\n            restore_fn()?;\n        }\n        Ok(())\n    }","sourceCodeStart":990,"sourceCodeEnd":1026,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/system/src/trader.rs#L990-L1026","documentation":"Composite failure in start_exec_algorithm_if_not_running: starting the execution algorithm failed, and the compensating rollback of its restored message-bus subscriptions also failed; both errors are reported because subscriptions may leak.","triggerScenarios":"Thrown at crates/system/src/trader.rs:1008 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the algorithm start failure (check its config and dependencies)","If rollback failed, inspect and clean up lingering message-bus subscriptions manually"],"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-14T00:17:10.932Z"}