{"record":{"id":"0a6ae3ec19659690","repo":"nautechsystems/nautilus_trader","slug":"modify-order-failed-e","errorCode":null,"errorMessage":"Modify order failed: {e}","messagePattern":"Modify order failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":3459,"sourceCode":"                            command.client_order_id,\n                            format!(\"modify-order-failed: {e}\").into(),\n                            UUID4::new(),\n                            ts_now,\n                            ts_now,\n                            false,\n                            command.venue_order_id,\n                            Some(account_id),\n                        );\n\n                        emitter.send_order_event(OrderEventAny::ModifyRejected(rejected));\n                    } else {\n                        log::warn!(\n                            \"Ambiguous modify failure for {}, awaiting reconciliation: {e}\",\n                            command.client_order_id\n                        );\n                    }\n\n                    anyhow::bail!(\"Modify order failed: {e}\");\n                }\n            }\n\n            Ok(())\n        });\n\n        Ok(())\n    }\n\n    fn cancel_order(&self, cmd: CancelOrder) -> anyhow::Result<()> {\n        self.cancel_order_internal(&cmd);\n        Ok(())\n    }\n\n    fn cancel_all_orders(&self, cmd: CancelAllOrders) -> anyhow::Result<()> {\n        let http_client = self.http_client.clone();\n        let instrument_id = cmd.instrument_id;\n","sourceCodeStart":3441,"sourceCodeEnd":3477,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/execution.rs#L3441-L3477","documentation":"Raised when the HTTP/REST modify-order path fails after possible ambiguity — the adapter logs 'Ambiguous modify failure ... awaiting reconciliation' when it cannot confirm whether the modify took effect, and then bails with the underlying error. Unlike the WS path, this error leaves the order state uncertain until reconciliation runs.","triggerScenarios":"Calling modify_order over the HTTP fallback with a rejected request or an ambiguous failure (timeout, disconnect after submit, unknown final state).","commonSituations":"Network interruption between request and response; exchange rejecting the modify (order filled/canceled); rate-limit or timestamp errors on the REST endpoint.","solutions":["Wait for reconciliation to establish the true order state before retrying blindly","Check the wrapped {e} for the exchange error code and correct the modify parameters","If the order state is unknown, query order status (by client_order_id) before deciding to cancel/replace","Retry only idempotent-safe operations after confirming the order is still open","Check connectivity and clock skew if the error is a timeout"],"exampleFix":"// before\nclient.modify_order(...)?; // may be ambiguous\n// after\nif let Err(e) = client.modify_order(...) {\n    log::warn!(\"modify failed, reconciling: {e}\");\n    let status = client.query_order_status(client_order_id)?;\n    // decide retry vs cancel/replace based on status\n}","handlingStrategy":"retry","validationCode":"// verify order still open and parameters valid before HTTP modify\nlet status = client.query_order_status(client_order_id)?;\nif status != OPEN { return Err(anyhow::anyhow!(\"order not open\")); }","typeGuard":null,"tryCatchPattern":"if let Err(e) = client.modify_order(...) { log::warn!(\"ambiguous: {e}\"); wait_for_reconciliation(); then_decide_retry_or_replace(); }","preventionTips":["Never retry blindly after an ambiguous modify failure","Always reconcile order state after HTTP modify errors","Prefer the WS modify path when available"],"tags":["rust","binance","http","order-modify","reconciliation"],"backgroundTag":"api-error-response","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}