{"record":{"id":"92a0e9ccfd97b058","repo":"nautechsystems/nautilus_trader","slug":"failed-to-start-actor-actor-id-start-err-rol","errorCode":null,"errorMessage":"Failed to start actor {actor_id}: {start_err}; rollback failed: {rollback_err}","messagePattern":"Failed to start actor (.+?): (.+?); rollback failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/system/src/controller.rs","lineNumber":343,"sourceCode":"        if !start {\n            return Ok(());\n        }\n\n        if let Err(start_err) = self.start_strategy(&strategy_id) {\n            return Err(self.rollback_strategy_start_failure(strategy_id, start_err));\n        }\n\n        Ok(())\n    }\n\n    fn rollback_actor_start_failure(\n        &self,\n        actor_id: ActorId,\n        start_err: anyhow::Error,\n    ) -> anyhow::Error {\n        match self.remove_actor(&actor_id) {\n            Ok(()) => start_err,\n            Err(rollback_err) => anyhow::anyhow!(\n                \"Failed to start actor {actor_id}: {start_err}; rollback failed: {rollback_err}\"\n            ),\n        }\n    }\n\n    fn rollback_strategy_start_failure(\n        &self,\n        strategy_id: StrategyId,\n        start_err: anyhow::Error,\n    ) -> anyhow::Error {\n        match self.remove_strategy(&strategy_id) {\n            Ok(()) => start_err,\n            Err(rollback_err) => anyhow::anyhow!(\n                \"Failed to start strategy {strategy_id}: {start_err}; rollback failed: {rollback_err}\"\n            ),\n        }\n    }\n","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/system/src/controller.rs#L325-L361","documentation":"When an actor fails to start, the TradingSystemController attempts to roll back by removing the half-started actor via remove_actor. If the rollback itself also fails, the original start error would be lost, so both errors are combined into this single aggregated error naming the actor, the original start failure, and the rollback failure.","triggerScenarios":"start_created_actor fails to start an actor (start_err), and the subsequent remove_actor cleanup also errors (rollback_err) — e.g. the actor is in a state where it cannot be removed, or the component registry is inconsistent.","commonSituations":"Actor start failure due to bad configuration compounded by a panicked or dead actor that cannot be removed; double-start races where the actor was already removed by another path; kernel/component state corruption after an earlier failure.","solutions":["Fix the root start error ({start_err} in the message) first — the rollback failure is secondary","Investigate why remove_actor failed: check whether the actor was already removed or the registry is locked/inconsistent","Add guards so actors are not started twice concurrently for the same ActorId","Reproduce with logging enabled at DEBUG for the controller to see both failure points in order"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before start_created_actor\nassert!(!controller.has_actor(&actor_id), \"actor {actor_id} already registered — would make rollback ambiguous\");","typeGuard":null,"tryCatchPattern":"match system.start() {\n    Err(e) if e.to_string().contains(\"rollback failed\") => {\n        log::error!(\"actor start AND rollback failed — system state inconsistent, restart required: {e:#}\");\n        // treat the system as unrecoverable; rebuild controller state\n    }\n    other => other?,\n}","preventionTips":["Prevent duplicate actor IDs via config validation before system start","Make remove_actor idempotent/tolerant of already-removed actors to keep rollback reliable","Log start failures at the source so the combined error can be triaged quickly"],"tags":["actor","lifecycle","rollback","system-controller"],"backgroundTag":"invalid-state-transition","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"}