{"record":{"id":"3007cd0e25060fff","repo":"nautechsystems/nautilus_trader","slug":"runner-already-consumed-run-called-twice","errorCode":null,"errorMessage":"Runner already consumed - run() called twice","messagePattern":"Runner already consumed - run\\(\\) called twice","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/live/src/node/mod.rs","lineNumber":1021,"sourceCode":"        self.run_with_mode(NodeRunMode::Owned).await\n    }\n\n    /// Run the live node under the given mode.\n    ///\n    /// [`NodeRunMode::Hosted`] leaves signal handling to the host application. Every other\n    /// responsibility, including maintenance, reconciliation, external ingress, and the shutdown\n    /// sequence, is identical across modes so that hosted and owned nodes cannot diverge.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the node fails to start or encounters a runtime error.\n    pub async fn run_with_mode(&mut self, mode: NodeRunMode) -> anyhow::Result<()> {\n        if self.state().is_running() {\n            anyhow::bail!(\"Already running\");\n        }\n\n        if self.runner.is_none() {\n            anyhow::bail!(\"Runner already consumed - run() called twice\");\n        }\n\n        self.prepare_cache().await?;\n\n        let Some(runner) = self.runner.take() else {\n            anyhow::bail!(\"Runner already consumed - run() called twice\");\n        };\n        runner.bind_senders();\n\n        let AsyncRunnerChannels {\n            mut time_evt_rx,\n            mut system_evt_rx,\n            mut system_cmd_rx,\n            mut exec_evt_rx,\n            mut exec_cmd_rx,\n            mut data_evt_rx,\n            mut data_cmd_rx,\n        } = runner.take_channels();","sourceCodeStart":1003,"sourceCodeEnd":1039,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/live/src/node/mod.rs#L1003-L1039","documentation":"One-shot guard in LiveNode::run_with_mode: the node's runner has already been consumed by a previous run() call and cannot be taken again. The node struct is single-use per run, so a second run is rejected.","triggerScenarios":"Thrown at crates/live/src/node/mod.rs:1021 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call run() exactly once per node instance","Create a new node instance for a fresh lifecycle"],"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"}