nautechsystems/nautilus_trader · error

Not running

Error message

Not running

What it means

Lifecycle guard in LiveNode::stop: the node's state is not Running, so there is nothing to shut down and stop was called outside an active run. The call is rejected rather than performing a spurious shutdown.

Source

Thrown at crates/live/src/node/mod.rs:525

        if !self.finish_startup_trader(None).await? {
            return Ok(());
        }

        Ok(())
    }

    /// Stop the live node.
    ///
    /// This method stops the trader, waits for the configured grace period to allow
    /// residual events to be processed, then finalizes the shutdown sequence.
    ///
    /// # Errors
    ///
    /// Returns an error if shutdown fails.
    pub async fn stop(&mut self) -> anyhow::Result<()> {
        if !self.state().is_running() {
            anyhow::bail!("Not running");
        }

        self.handle.set_shutting_down();

        #[cfg(feature = "plugin")]
        let controller_stop_result = self.plugins.stop_controllers();
        #[cfg(not(feature = "plugin"))]
        let controller_stop_result: anyhow::Result<()> = Ok(());

        self.kernel.stop_trader();
        let delay = self.kernel.delay_post_stop();
        log::info!("Awaiting residual events ({delay:?})...");

        let residual_events = self.process_runner_for(delay).await;
        if residual_events > 0 {
            log::debug!("Processed {residual_events} residual events during shutdown");
        }

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Check the node state before calling stop
  2. Only call stop after a successful start/run
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/live/src/node/mod.rs:525 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/5eba5e6ceb93e132. Report an issue: GitHub.