{"record":{"id":"eebe8b279d5dfdd0","repo":"nautechsystems/nautilus_trader","slug":"failed-to-send-order-denied-event-e-eebe8b","errorCode":null,"errorMessage":"Failed to send order denied event: {e}","messagePattern":"Failed to send order denied event: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/interactive_brokers/src/execution/core_orders.rs","lineNumber":46,"sourceCode":"        clock: &'static AtomicTime,\n        account_id: AccountId,\n        order_submit_lock: &Arc<tokio::sync::Mutex<()>>,\n    ) -> anyhow::Result<()> {\n        if cmd.order_init.post_only {\n            let ts_event = clock.get_time_ns();\n            let event = OrderDenied::new(\n                cmd.order_init.trader_id,\n                cmd.strategy_id,\n                cmd.instrument_id,\n                cmd.order_init.client_order_id,\n                Ustr::from(\"`post_only` not supported by Interactive Brokers\"),\n                UUID4::new(),\n                ts_event,\n                ts_event,\n            );\n            exec_sender\n                .send(ExecutionEvent::Order(OrderEventAny::Denied(event)))\n                .map_err(|e| anyhow::anyhow!(\"Failed to send order denied event: {e}\"))?;\n            anyhow::bail!(\"`post_only` not supported by Interactive Brokers\");\n        }\n\n        let is_inverse = instrument_provider\n            .find(&cmd.instrument_id)\n            .map(|instrument| instrument.is_inverse())\n            .unwrap_or(false);\n\n        if cmd.order_init.quote_quantity && !is_inverse {\n            let ts_event = clock.get_time_ns();\n            let event = OrderDenied::new(\n                cmd.order_init.trader_id,\n                cmd.strategy_id,\n                cmd.instrument_id,\n                cmd.order_init.client_order_id,\n                Ustr::from(\"UNSUPPORTED_QUOTE_QUANTITY\"),\n                UUID4::new(),\n                ts_event,","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/interactive_brokers/src/execution/core_orders.rs#L28-L64","documentation":"This error wraps a failure to deliver an OrderDenied event over the exec_sender channel while rejecting an order whose `post_only` flag is not supported by Interactive Brokers. It is a secondary error: the adapter tries to report the denial to the execution engine, and if the event channel itself is closed/saturated, the send failure becomes this anyhow error. The original denial reason (post_only unsupported) is then raised with anyhow::bail!.","triggerScenarios":"Submitting an order via handle_submit_order_async with order_init.post_only set to true while using the Interactive Brokers adapter; the send itself fails only when the execution event channel is closed or disconnected.","commonSituations":"Users porting Binance-style post_only (maker-only) orders to IB, which expresses this via TIF/time-in-force semantics rather than a post_only flag; also occurs when the adapter's exec sender was shut down (adapter disconnect) mid-submission.","solutions":["Set post_only = false on the order (or omit it); emulate maker-only behavior with an IB limit order and LEE/MKT TIF instead.","Use an order type supported by IB (limit orders only for post-only-like behavior).","Check that the adapter's execution event channel is alive; reconnect the execution client if the send itself failed.","Inspect the chained error message from the send (the {e} payload) to distinguish channel failure from the intended denial."],"exampleFix":"// before\nlet cmd = SubmitOrder::new(..., post_only: true, ...);\n// after\nlet cmd = SubmitOrder::new(..., post_only: false, ...); // IB does not support post_only","handlingStrategy":"validation","validationCode":"if order_init.post_only {\n    return Err(anyhow::anyhow!(\"IB adapter does not support post_only orders\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never set post_only for Interactive Brokers orders; use limit orders with appropriate TIF.","Check adapter capability docs before reusing order configs across venues.","Validate order flags against the target venue in strategy pre-trade checks."],"tags":["interactive-brokers","order-denied","unsupported-feature","rust"],"backgroundTag":"unsupported-operation","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"}