nautechsystems/nautilus_trader · error

Failed to start execution algorithm {exec_algorithm_id}: {st

Error message

Failed to start execution algorithm {exec_algorithm_id}: {start_err:#}; failed to roll back subscriptions: {cleanup_err:#}

What it means

Composite failure in start_exec_algorithm_if_not_running: starting the execution algorithm failed, and the compensating rollback of its restored message-bus subscriptions also failed; both errors are reported because subscriptions may leak.

Source

Thrown at crates/system/src/trader.rs:1008

            return Ok(());
        }

        start_component(&component_id)
    }

    fn start_exec_algorithm_if_not_running(
        &mut self,
        exec_algorithm_id: ExecAlgorithmId,
    ) -> anyhow::Result<bool> {
        if component_state(&exec_algorithm_id.inner())? == ComponentState::Running {
            return Ok(false);
        }

        self.restore_exec_algorithm_subscriptions(exec_algorithm_id)?;
        if let Err(start_err) = start_component(&exec_algorithm_id.inner()) {
            return match self.cleanup_exec_algorithm_subscriptions(exec_algorithm_id) {
                Ok(()) => Err(start_err),
                Err(cleanup_err) => anyhow::bail!(
                    "Failed to start execution algorithm {exec_algorithm_id}: {start_err:#}; \
                     failed to roll back subscriptions: {cleanup_err:#}"
                ),
            };
        }

        Ok(true)
    }

    fn restore_exec_algorithm_subscriptions(
        &mut self,
        exec_algorithm_id: ExecAlgorithmId,
    ) -> anyhow::Result<()> {
        if let Some(restore_fn) = self.exec_algorithm_restore_fns.get_mut(&exec_algorithm_id) {
            restore_fn()?;
        }
        Ok(())
    }

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Fix the algorithm start failure (check its config and dependencies)
  2. If rollback failed, inspect and clean up lingering message-bus subscriptions manually
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/system/src/trader.rs:1008 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/184b9725a06e1afb. Report an issue: GitHub.