nautechsystems/nautilus_trader · error · anyhow::Error
failed to build order query params: {e}
Error message
failed to build order query params: {e} What it means
Maps a derive_builder validation failure while constructing BinanceOrderQueryParams for the order query. symbol is the only required field and is always set from the command's instrument_id, while orig_client_order_id is always populated via encode_broker_id, so this error is a defensive path rather than a runtime condition.
Source
Thrown at crates/adapters/binance/src/futures/execution.rs:2366
Err(e) => log::warn!("Failed to query algo order status: {e}"),
}
return Ok(());
}
let mut builder = BinanceOrderQueryParamsBuilder::default();
builder.symbol(symbol.clone());
if let Some(oid) = order_id {
builder.order_id(oid);
}
if let Some(coid) = orig_client_order_id {
builder.orig_client_order_id(coid);
}
let params = builder
.build()
.map_err(|e| anyhow::anyhow!("failed to build order query params: {e}"))?;
let result = http_client.query_order(¶ms).await;
match result {
Ok(order) => {
let ts_init = clock.get_time_ns();
let report = order.to_order_status_report(
account_id,
command.instrument_id,
price_precision,
size_precision,
treat_expired_as_canceled,
ts_init,
)?;
emitter.send_order_status_report(report);
}
Err(BinanceFuturesHttpError::BinanceError { code: -2013, .. }) => {View on GitHub (pinned to a4b06ed870)
Solutions
- Ensure symbol is set on the builder before .build()
- Inspect {e} for the missing field name
- Report as a bug if unmodified code produces it
Defensive patterns
Strategy: try-catch
Try / catch
Catch the anyhow::Error in the query_order task result and log with the client_order_id; deterministic, so no retry.
Prevention
- Pin adapter versions in production
- Smoke-test order status queries after upgrades
- In forks, keep the symbol setter on BinanceOrderQueryParamsBuilder
When it happens
Trigger: The spawned query_order task builds BinanceOrderQueryParamsBuilder with symbol plus optional order_id / orig_client_order_id and .build() returns Err — only realistic in modified code that drops the symbol setter.
Common situations: Order status queries in custom builds of the adapter; unreachable as shipped.
Related errors
- failed to parse venue_order_id: {e}
- Binance only supports TrailingOffsetType::BasisPoints, recei
- `close_position` is not supported for order type {order_type
- `close_position` cannot be combined with `reduce_only` on Bi
- price_match cannot be combined with post-only orders
AI-assisted analysis of nautechsystems/nautilus_trader@a4b06ed870 (2026-08-16).
Data as JSON: /api/errors/2e2aabfba5586c28.
Report an issue: GitHub.