{"record":{"id":"d15d86f933b3a509","repo":"nautechsystems/nautilus_trader","slug":"order-list-is-missing-child-reports","errorCode":null,"errorMessage":"order list {} is missing {} child reports","messagePattern":"order list (.+?) is missing (.+?) child reports","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/spot/execution.rs","lineNumber":2611,"sourceCode":"    }\n\n    anyhow::ensure!(\n        list_orders.is_empty(),\n        \"order list {} is missing {} child reports\",\n        response.order_list_id,\n        list_orders.len(),\n    );\n    Ok(())\n}\n\nfn prepare_cancel_order(\n    response: &BinanceCancelOrderResponse,\n    order_list: bool,\n    order_ids: &mut AHashSet<(InstrumentId, i64)>,\n    client_order_ids: &mut AHashSet<ClientOrderId>,\n    prepared: &mut Vec<PreparedCancelOrder>,\n) -> anyhow::Result<()> {\n    anyhow::ensure!(\n        response.order_id >= 0\n            && !response.symbol.is_empty()\n            && !response.orig_client_order_id.is_empty(),\n        \"cancel-all response has an invalid order ID, symbol, or original client order ID\",\n    );\n    anyhow::ensure!(\n        response.status == SbeOrderStatus::Canceled,\n        \"order {} reports status {:?}, expected Canceled\",\n        response.order_id,\n        response.status,\n    );\n    let client_order_id = decode_client_order_id(\n        &response.orig_client_order_id,\n        BINANCE_NAUTILUS_SPOT_BROKER_ID,\n    )?;\n    let instrument_id = InstrumentId::new(response.symbol.as_str().into(), *BINANCE_VENUE);\n    anyhow::ensure!(\n        order_ids.insert((instrument_id, response.order_id)),","sourceCodeStart":2593,"sourceCodeEnd":2629,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/spot/execution.rs#L2593-L2629","documentation":"Raised by prepare_cancel_order while processing a Binance cancel-all/cancel-list response: the count of successfully canceled orders in the response does not match the number of child order reports included. Binance aggregates cancel requests per order list; each canceled child order must report its own result. A mismatch means the HTTP response is incomplete or malformed relative to the cancel request.","triggerScenarios":"Calling cancel_all_orders or cancel_order_list through the Binance spot execution client when the SBE-decoded response's child report list length is less than the declared canceled-order count — e.g. a truncated/corrupt response payload or an adapter decode bug.","commonSituations":"Rare in practice; seen during Binance SBE API migrations, partial network reads, or when Binance returns an unexpected response shape during cancel-all on many open orders.","solutions":["Retry the cancel operation; the next response is usually well-formed","Upgrade to the latest nautilus_trader version in case of an SBE decode fix","Log and report the raw response if reproducible; verify Binance API status","Fall back to canceling orders individually via cancel_order"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match result { Err(e) if e.to_string().contains(\"missing\") && e.to_string().contains(\"child reports\") => retry_with_backoff(), Err(e) => halt_and_report(e), Ok(_) => continue }","preventionTips":["Keep nautilus_trader and its Binance adapter up to date","Monitor Binance API changelog for SBE schema changes","Fall back to per-order cancels when batch cancels fail"],"tags":["binance","cancel-order","response-validation"],"backgroundTag":"unexpected-response-shape","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"}