nautechsystems/nautilus_trader · error
order list has an invalid list ID or empty symbol
Error message
order list has an invalid list ID or empty symbol
What it means
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.
Source
Thrown at crates/adapters/binance/src/spot/execution.rs:2534
response,
&mut order_ids,
&mut client_order_ids,
&mut prepared,
)?;
}
}
}
Ok(prepared)
}
fn prepare_cancel_order_list(
response: BinanceCancelOrderListResponse,
order_ids: &mut AHashSet<(InstrumentId, i64)>,
client_order_ids: &mut AHashSet<ClientOrderId>,
prepared: &mut Vec<PreparedCancelOrder>,
) -> anyhow::Result<()> {
anyhow::ensure!(
response.order_list_id >= 0 && !response.symbol.is_empty(),
"order list has an invalid list ID or empty symbol",
);
anyhow::ensure!(
response.list_status_type == SbeListStatusType::AllDone
&& response.list_order_status == SbeListOrderStatus::AllDone,
"order list {} was not fully canceled: status={:?}, order_status={:?}",
response.order_list_id,
response.list_status_type,
response.list_order_status,
);
anyhow::ensure!(
!response.orders.is_empty() && response.orders.len() == response.order_reports.len(),
"order list {} has {} orders and {} reports",
response.order_list_id,
response.orders.len(),
response.order_reports.len(),
);View on GitHub (pinned to 18893faf8b)
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
Defensive patterns
Strategy: try-catch
Try / catch
match prepare_cancel_all_orders_response(resp) {
Err(e) if e.to_string().contains("invalid list ID or empty symbol") => {
tracing::warn!("malformed cancel list response, retrying");
// retry or fall back to per-order cancel
},
Err(e) => return Err(e),
Ok(prep) => process(prep),
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Exchange hiccup returning placeholder values; deserialization of a truncated/renamed SBE field; response captured mid-cancel where the list context is not yet known.
Related errors
- cancel-all response contains an order for a different instru
- order list {} was not fully canceled: status={:?}, order_sta
- order list {} has {} orders and {} reports
- order list {} contains order {} for symbol {}, expected {}
- order list {} contains a duplicate order ID
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/b83c3256994911e8.
Report an issue: GitHub.