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

  1. Inspect the raw response payload to confirm order_list_id and symbol values from the exchange
  2. Retry the cancel-all; transient malformed responses are usually not reproducible
  3. If reproducible, capture the message and report a bug with the raw response bytes
  4. 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

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


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/b83c3256994911e8. Report an issue: GitHub.