nautechsystems/nautilus_trader · error

{}

Error message

{}

What it means

abort_started_trader rolls back a trader that was partially started; any errors encountered while aborting are collected, joined with '; ', and returned as a single anyhow error. The message is entirely composed of the accumulated cleanup failures.

Source

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

        let mut errors = Vec::new();

        if let Err(e) = controller_stop_result {
            errors.push(format!("Failed to stop plug-in controllers: {e}"));
        }

        if let Err(e) = trader_stop_result {
            errors.push(format!("Failed to stop trader: {e}"));
        }

        if let Err(e) = finalize_result {
            errors.push(format!("Failed to finalize startup abort: {e}"));
        }

        if errors.is_empty() {
            Ok(())
        } else {
            anyhow::bail!("{}", errors.join("; "))
        }
    }

    async fn process_receivers_for(
        &mut self,
        duration: Duration,
        receivers: &mut RunnerReceivers<'_>,
    ) -> usize {
        let deadline = dst::time::Instant::now() + duration;
        let mut processed = 0;

        loop {
            tokio::select! {
                biased;

                () = dst::time::sleep_until(deadline) => break,
                Some(message) = receivers.time_evt.recv() => {
                    let _ = AsyncRunner::handle_time_event(message);

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Parse the '; '-joined message: each segment is one distinct cleanup failure
  2. Fix the underlying reason the trader needed aborting in the first place
  3. Address each listed cleanup failure (often ordering/double-stop issues)
  4. Add logging around the abort steps to pinpoint which step failed
Defensive patterns

Strategy: try-catch

Try / catch

if let Err(e) = node.finish_startup_trader().await {
    for seg in e.to_string().split("; ") {
        tracing::error!(abort_error = seg, "startup abort failure segment");
    }
}

Prevention

When it happens

Trigger: finish_startup_trader encounters a startup failure after the trader has begun starting, then abort_started_trader runs and one or more of its cleanup steps (stopping components, finalizing abort) each push errors into the errors vec.

Common situations: Partial-start failures such as an actor/strategy failing during start, combined with cleanup steps that also fail (e.g. stopping an engine already in a bad state, connection teardown errors).

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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