nautechsystems/nautilus_trader · error · anyhow::Error

Failed to send order submitted event: {e}

Error message

Failed to send order submitted event: {e}

What it means

After constructing the IB order and contract, the adapter emits an OrderSubmitted event via exec_sender before awaiting the actual client.submit_order call. This error is the map_err wrapper on that send — it means the internal execution event channel rejected the Submitted event, so downstream strategy/execution components will never see the submission.

Source

Thrown at crates/adapters/interactive_brokers/src/execution/core_orders.rs:155

            active_order_contexts,
            terminal_order_contexts,
        );

        let ts_event = clock.get_time_ns();
        let event = OrderSubmitted::new(
            cmd.order_init.trader_id,
            cmd.strategy_id,
            cmd.instrument_id,
            cmd.order_init.client_order_id,
            account_id,
            UUID4::new(),
            ts_event,
            ts_event,
        );

        exec_sender
            .send(ExecutionEvent::Order(OrderEventAny::Submitted(event)))
            .map_err(|e| anyhow::anyhow!("Failed to send order submitted event: {e}"))?;

        if let Err(e) = client.submit_order(ib_order_id, &contract, &ib_order).await {
            return Self::handle_order_submit_failure(
                &e,
                "Failed to submit order",
                ib_order_id,
                account_id,
                ts_event,
                order_id_map,
                venue_order_id_map,
                instrument_id_map,
                trader_id_map,
                strategy_id_map,
                active_order_contexts,
                terminal_order_contexts,
                exec_sender,
                clock,
            );

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Inspect the inner {e} from the channel send to confirm the receiver was dropped.
  2. Ensure the ExecutionEngine and its exec_sender are alive before submitting orders; restart the node if the channel was torn down.
  3. Avoid calling submit during adapter shutdown; gate submissions on client connection state.
  4. Check MessageBus/exec channel capacity configuration if saturation is the cause.
Defensive patterns

Strategy: try-catch

Validate before calling

assert!(!exec_sender.is_closed(), "execution event channel receiver dropped");

Try / catch

if let Err(e) = exec_client.submit_order(cmd).await {
    if e.to_string().contains("Failed to send order submitted event") {
        // exec channel down: stop trading and reconnect
    }
}

Prevention

When it happens

Trigger: handle_submit_order_async reaching the event-emit stage with a closed, full, or disconnected exec_sender channel (e.g. the ExecutionEngine/MessageBus receiver was dropped or the adapter is shutting down).

Common situations: Stopping/disconnecting the trading node while orders are in flight; a bug causing the exec receiver to be dropped early; event bus backpressure or misconfiguration.

Related errors


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