{"record":{"id":"0476e538287d7da3","repo":"nautechsystems/nautilus_trader","slug":"invalid-livenode-control-state-control-04x-whil","errorCode":null,"errorMessage":"Invalid LiveNode control state {control:#04x} while entering Running","messagePattern":"Invalid LiveNode control state (.+?) while entering Running","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/live/src/node/mod.rs","lineNumber":2143,"sourceCode":"        } else if self.kernel.is_shutdown_requested() {\n            Some(\"Shutdown signal received during startup\")\n        } else {\n            None\n        }\n    }\n\n    async fn finish_startup_replay(&mut self) -> anyhow::Result<bool> {\n        match self.handle.try_set_running() {\n            RunningTransition::Entered => Ok(true),\n            RunningTransition::StopRequested => {\n                self.abort_startup(\"Stop signal received during startup\")\n                    .await?;\n                Ok(false)\n            }\n            RunningTransition::Invalid(control) => {\n                self.abort_startup_with_error(\n                    \"Invalid lifecycle state during startup\",\n                    anyhow::anyhow!(\n                        \"Invalid LiveNode control state {control:#04x} while entering Running\"\n                    ),\n                )\n                .await?;\n                Ok(false)\n            }\n        }\n    }\n\n    async fn finish_startup_trader(\n        &mut self,\n        receivers: Option<&mut RunnerReceivers<'_>>,\n    ) -> anyhow::Result<bool> {\n        match self.handle.try_set_running() {\n            RunningTransition::Entered => Ok(true),\n            RunningTransition::StopRequested => {\n                self.abort_started_trader(\"Stop signal received during startup\", receivers)\n                    .await?;","sourceCodeStart":2125,"sourceCodeEnd":2161,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/live/src/node/mod.rs#L2125-L2161","documentation":"finish_startup_replay asks the node to transition its lifecycle control state into Running; RunningTransition::Invalid(control) means the LiveNode's internal control state machine was in a state from which entering Running is not a valid transition. The node aborts startup with this error carrying the raw control bitmask. This signals an internal lifecycle bug or corrupted state rather than a user configuration problem.","triggerScenarios":"During start()/run_with_mode on the event-store replay path, finish_startup_replay receives RunningTransition::Invalid(control) from the state transition (mod.rs:2142-2150).","commonSituations":"A stop/shutdown signal raced with startup so the state moved past the valid Running entry point; concurrent control calls; a bug in lifecycle management leaving the control state in an unexpected bitmask.","solutions":["Restart the node cleanly; transient signal races typically resolve on a fresh startup.","Ensure nothing sends stop/shutdown signals to the node concurrently with startup.","Capture the reported control value and file a bug — an invalid transition from normal startup flow indicates a lifecycle invariant violation.","Verify no custom runner/embedding code manipulates node control state directly."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Do not send control signals concurrently with startup\nassert!(!shutdown_requested.load(Ordering::SeqCst), \"stop signalled before/during start()\");","typeGuard":null,"tryCatchPattern":"match node.start().await {\n    Err(e) if e.to_string().contains(\"Invalid LiveNode control state\") => {\n        // capture control bitmask from message, restart cleanly, report upstream\n    }\n    other => other?,\n}","preventionTips":["Never call stop()/shutdown while start() or run() is still in flight","Coordinate signal handlers so SIGINT/SIGTERM waits for startup completion","Create a fresh node instance after any abort instead of reusing state","Report reproducible invalid transitions with the control value upstream"],"tags":["lifecycle","state-machine","internal","replay"],"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"}