{"record":{"id":"9e3a20de5acf8efa","repo":"nautechsystems/nautilus_trader","slug":"failed-to-send-order-submitted-event-e","errorCode":null,"errorMessage":"Failed to send order submitted event: {e}","messagePattern":"Failed to send order submitted event: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/interactive_brokers/src/execution/core_orders.rs","lineNumber":155,"sourceCode":"            active_order_contexts,\n            terminal_order_contexts,\n        );\n\n        let ts_event = clock.get_time_ns();\n        let event = OrderSubmitted::new(\n            cmd.order_init.trader_id,\n            cmd.strategy_id,\n            cmd.instrument_id,\n            cmd.order_init.client_order_id,\n            account_id,\n            UUID4::new(),\n            ts_event,\n            ts_event,\n        );\n\n        exec_sender\n            .send(ExecutionEvent::Order(OrderEventAny::Submitted(event)))\n            .map_err(|e| anyhow::anyhow!(\"Failed to send order submitted event: {e}\"))?;\n\n        if let Err(e) = client.submit_order(ib_order_id, &contract, &ib_order).await {\n            return Self::handle_order_submit_failure(\n                &e,\n                \"Failed to submit order\",\n                ib_order_id,\n                account_id,\n                ts_event,\n                order_id_map,\n                venue_order_id_map,\n                instrument_id_map,\n                trader_id_map,\n                strategy_id_map,\n                active_order_contexts,\n                terminal_order_contexts,\n                exec_sender,\n                clock,\n            );","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/interactive_brokers/src/execution/core_orders.rs#L137-L173","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Inspect the inner {e} from the channel send to confirm the receiver was dropped.","Ensure the ExecutionEngine and its exec_sender are alive before submitting orders; restart the node if the channel was torn down.","Avoid calling submit during adapter shutdown; gate submissions on client connection state.","Check MessageBus/exec channel capacity configuration if saturation is the cause."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"assert!(!exec_sender.is_closed(), \"execution event channel receiver dropped\");","typeGuard":null,"tryCatchPattern":"if let Err(e) = exec_client.submit_order(cmd).await {\n    if e.to_string().contains(\"Failed to send order submitted event\") {\n        // exec channel down: stop trading and reconnect\n    }\n}","preventionTips":["Ensure graceful shutdown ordering: cancel/complete in-flight orders before stopping the engine.","Monitor channel health (is_closed) in a health-check task.","Size exec channels for peak order throughput."],"tags":["interactive-brokers","channel","event-bus","rust","tokio"],"backgroundTag":"broken-pipe","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"}