nautechsystems/nautilus_trader · error
generate_order_status_report requires venue_order_id
Error message
generate_order_status_report requires venue_order_id
What it means
generate_order_status_report_impl requires a venue order id to query Polymarket. resolve_venue_order_id could not derive one from cmd.venue_order_id or cmd.client_order_id, so the request is rejected before any HTTP call.
Source
Thrown at crates/adapters/polymarket/src/execution/reports.rs:518
Ok(None) => {
log::warn!("Order {venue_order_id_str} not found (empty response)");
}
Err(e) => {
log::warn!("Failed to query order {venue_order_id_str}: {e}");
}
}
Ok(())
});
}
pub(super) async fn generate_order_status_report_impl(
&self,
cmd: &GenerateOrderStatusReport,
) -> anyhow::Result<Option<OrderStatusReport>> {
let Some(venue_order_id) =
self.resolve_venue_order_id(cmd.venue_order_id, cmd.client_order_id)
else {
anyhow::bail!("generate_order_status_report requires venue_order_id");
};
let Some(instrument_id) = cmd.instrument_id else {
anyhow::bail!("generate_order_status_report requires instrument_id");
};
let authority = self.resolve_target_order_authority(
cmd.client_order_id,
venue_order_id,
Some(instrument_id),
)?;
let cached_authority = authority
.client_order_id
.map(|_| authority.require_cached_base_limit(venue_order_id).cloned())
.transpose()?;
let instrument = self
.core
.cache()View on GitHub (pinned to 18893faf8b)
Solutions
- Set cmd.venue_order_id to the id returned when the order was submitted.
- Provide a resolvable client_order_id (one previously registered/submitted through this client) so resolve_venue_order_id can map it.
- Look up the venue order id from persisted order state or a prior OrderStatusReport before issuing the request.
Example fix
// before
let cmd = GenerateOrderStatusReport { instrument_id: Some(instrument_id), ..Default::default() };
// after
let cmd = GenerateOrderStatusReport { venue_order_id: Some(venue_order_id), instrument_id: Some(instrument_id), ..Default::default() }; Defensive patterns
Strategy: validation
Validate before calling
// Rust: require an order identifier before building the request
fn status_cmd_ready(cmd: &GenerateOrderStatusReport) -> bool {
cmd.venue_order_id.is_some() || cmd.client_order_id.is_some()
}
assert!(status_cmd_ready(&cmd)); Type guard
fn has_order_id(cmd: &GenerateOrderStatusReport) -> Option<VenueOrderId> {
cmd.venue_order_id.or(cmd.client_order_id.map(resolve_from_registry))
} Prevention
- Persist venue_order_id from the submit response together with the client_order_id.
- Never construct GenerateOrderStatusReport from records lacking an order identifier.
- Keep a client_order_id -> venue_order_id registry populated on every order submission.
When it happens
Trigger: Calling generate_order_status_report with a GenerateOrderStatusReport that has neither venue_order_id set nor a client_order_id that resolve_venue_order_id can map to a venue order id.
Common situations: Constructing the report request manually with only an instrument_id; a client_order_id that was never registered with the venue so no mapping exists; dropping the venue_order_id from a persisted report before requesting a status refresh.
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
- generate_order_status_report requires instrument_id
- Either venue_order_id or client_order_id must be provided
- Either client_order_id or venue_order_id must be provided
- Either client_order_ids or venue_order_ids must be provided
- Either venue_order_id or client_order_id must be provided
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/bc282a5ce545fb26.
Report an issue: GitHub.