{"record":{"id":"b83c3256994911e8","repo":"nautechsystems/nautilus_trader","slug":"order-list-has-an-invalid-list-id-or-empty-symbol","errorCode":null,"errorMessage":"order list has an invalid list ID or empty symbol","messagePattern":"order list has an invalid list ID or empty symbol","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/spot/execution.rs","lineNumber":2534,"sourceCode":"                    response,\n                    &mut order_ids,\n                    &mut client_order_ids,\n                    &mut prepared,\n                )?;\n            }\n        }\n    }\n\n    Ok(prepared)\n}\n\nfn prepare_cancel_order_list(\n    response: BinanceCancelOrderListResponse,\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_list_id >= 0 && !response.symbol.is_empty(),\n        \"order list has an invalid list ID or empty symbol\",\n    );\n    anyhow::ensure!(\n        response.list_status_type == SbeListStatusType::AllDone\n            && response.list_order_status == SbeListOrderStatus::AllDone,\n        \"order list {} was not fully canceled: status={:?}, order_status={:?}\",\n        response.order_list_id,\n        response.list_status_type,\n        response.list_order_status,\n    );\n    anyhow::ensure!(\n        !response.orders.is_empty() && response.orders.len() == response.order_reports.len(),\n        \"order list {} has {} orders and {} reports\",\n        response.order_list_id,\n        response.orders.len(),\n        response.order_reports.len(),\n    );","sourceCodeStart":2516,"sourceCodeEnd":2552,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/spot/execution.rs#L2516-L2552","documentation":"A Binance cancel order-list (CANCEL_REST / OCO list) response arrived with a negative order_list_id or an empty symbol, meaning the response cannot be tied to a concrete order list on a concrete instrument. prepare_cancel_order_list rejects it before any cancel events are emitted to keep local order state consistent.","triggerScenarios":"cancel_all_orders receives a BinanceCancelOrderListResponse whose order_list_id < 0 or whose symbol field is empty — typically a malformed or partially-populated exchange response.","commonSituations":"Exchange hiccup returning placeholder values; deserialization of a truncated/renamed SBE field; response captured mid-cancel where the list context is not yet known.","solutions":["Inspect the raw response payload to confirm order_list_id and symbol values from the exchange","Retry the cancel-all; transient malformed responses are usually not reproducible","If reproducible, capture the message and report a bug with the raw response bytes","Ensure the adapter's SBE decoding for BinanceCancelOrderListResponse is up to date with the exchange schema"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match prepare_cancel_all_orders_response(resp) {\n    Err(e) if e.to_string().contains(\"invalid list ID or empty symbol\") => {\n        tracing::warn!(\"malformed cancel list response, retrying\");\n        // retry or fall back to per-order cancel\n    },\n    Err(e) => return Err(e),\n    Ok(prep) => process(prep),\n}","preventionTips":["Keep the adapter updated so SBE decoding matches the current Binance schema","Log raw exchange payloads on failure for diagnosis","Fall back to per-order cancel when list cancel responses are malformed","Verify deserialized fields (order_list_id, symbol) before consuming higher-level results"],"tags":["binance","order-list","response-validation","cancel-orders"],"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"}