nautechsystems/nautilus_trader · error
Either client_order_id or venue_order_id is required
Error message
Either client_order_id or venue_order_id is required
What it means
request_order_status_report can look up an order by client_order_id, by venue_order_id, or via resolve_order_context, but with neither ID provided there is no way to identify the order. The HTTP client bails immediately in the (None, None) match arm before calling get_order.
Source
Thrown at crates/adapters/coinbase/src/http/client.rs:1167
let query = OrderListQuery {
client_order_id_filter: Some(cid.as_str().to_string()),
..Default::default()
};
let orders = self
.inner
.fetch_all_orders(&query)
.await
.map_err(|e| anyhow::anyhow!("Failed to fetch orders: {e}"))?;
let order = orders
.into_iter()
.next()
.ok_or_else(|| anyhow::anyhow!("No order found for client_order_id={cid}"))?;
let instrument = self.get_or_fetch_instrument(order.product_id).await?;
let ts_init = self.ts_now();
return parse_order_status_report(&order, &instrument, account_id, ts_init);
}
(None, None) => {
anyhow::bail!("Either client_order_id or venue_order_id is required")
}
};
let json = self
.inner
.get_order(venue_order_id.as_str())
.await
.map_err(|e| anyhow::anyhow!("Failed to fetch order: {e}"))?;
let response: OrderResponse =
serde_json::from_value(json).map_err(|e| anyhow::anyhow!(e))?;
let instrument = self
.get_or_fetch_instrument(response.order.product_id)
.await?;
let ts_init = self.ts_now();
parse_order_status_report(&response.order, &instrument, account_id, ts_init)
}
/// Requests order status reports, optionally filtered by instrument, openView on GitHub (pinned to 18893faf8b)
Solutions
- Populate either client_order_id or venue_order_id before requesting the status report
- If only a client_order_id is known, pass it; the client resolves it against Coinbase's mappings
- Check upstream code that builds the report request to ensure an ID is set (resolve_order_context should supply one)
- Log the order struct at the call site to see which ID field is empty
Example fix
// before client.request_order_status_report(&order_report_req).await?; // req has no ids // after let req = order_report_req.with_client_order_id(client_order_id); client.request_order_status_report(&req).await?;
Defensive patterns
Strategy: validation
Validate before calling
if report_req.client_order_id.is_none() && report_req.venue_order_id.is_none() {
return Err(anyhow!("order status request needs client_order_id or venue_order_id"));
} Type guard
fn has_order_id(req: &OrderStatusReportRequest) -> bool {
req.client_order_id.is_some() || req.venue_order_id.is_some()
} Prevention
- Always stamp one order ID on status report requests at the call site
- Validate request structs before dispatching reconciliation flows
- Beware serializers that drop empty/None ID fields
- Prefer passing client_order_id consistently so context resolution works
When it happens
Trigger: Calling request_order_status_report (directly or through resolve_order_context) with both client_order_id and venue_order_id as None — e.g. a request with blank/unset identifiers.
Common situations: Reconciliation/report generation passing through an order struct with unset IDs; a bug where one ID format is expected but never populated; serialization dropping empty ID fields.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Modify order failed: {e}
- Order missing ord_status and cannot infer (order_id={}, clie
- generate_order_status_report requires venue_order_id
- generate_order_status_report requires instrument_id
- Order in list denied: invalid status for {}, expected INITIA
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/4e4bb4653e020963.
Report an issue: GitHub.