nautechsystems/nautilus_trader · error · anyhow::Error
get_order_events failed: {e}
Error message
get_order_events failed: {e} What it means
Wraps a failure of the get_order_events HTTP call used by request_order_status_reports when querying historical order events (with optional start/end time filters). The transport-level request failed, before any API result status is examined.
Source
Thrown at crates/adapters/kraken/src/http/futures/client.rs:1772
) {
Ok(report) => all_reports.push(report),
Err(e) => {
let order_id = &order.order_id;
log::warn!("Failed to parse futures order {order_id}: {e}");
}
}
}
}
if !open_only {
// Kraken Futures order events API expects Unix timestamp in milliseconds
let start_ms = start.map(|dt| dt.as_millisecond());
let end_ms = end.map(|dt| dt.as_millisecond());
let response = self
.inner
.get_order_events(end_ms, start_ms, None)
.await
.map_err(|e| anyhow::anyhow!("get_order_events failed: {e}"))?;
for event_wrapper in response.order_events {
let event = &event_wrapper.order;
if let Some(ref target_id) = instrument_id {
let instrument = self.get_cached_instrument(&target_id.symbol.inner());
if let Some(inst) = instrument
&& inst.raw_symbol().as_str() != event.symbol
{
continue;
}
}
if let Some(instrument) = self.get_instrument_by_raw_symbol(&event.symbol) {
match parse_futures_order_event_status_report(
event,
Some(event_wrapper.event_type),
&instrument,View on GitHub (pinned to 18893faf8b)
Solutions
- Inspect the wrapped source error for the concrete cause.
- Narrow the start/end reconciliation window to reduce request size.
- Re-check API key/secret validity and permissions.
- Retry; if persistent, check Kraken Futures API status and connectivity.
Defensive patterns
Strategy: retry
Validate before calling
assert!(end.unwrap_or_default() >= start.unwrap_or_default(), "event query window invalid");
Try / catch
match client.request_order_status_reports(instrument_id, Some(start), Some(end)).await {
Ok(r) => r,
Err(e) => { warn!("order events query failed, retrying: {e:#}"); sleep(backoff).await; retry(); }
} Prevention
- Keep reconciliation windows narrow to avoid oversized requests/timeouts.
- Validate credentials before long-running reconciliation sessions.
- Apply exponential backoff on transient transport errors.
When it happens
Trigger: request_order_status_reports calls inner.get_order_events(end_ms, start_ms, None) for a specific instrument_id or reconciliation window and the HTTP request fails — timeouts, network errors, signing failures.
Common situations: Querying very wide time ranges during reconciliation causing timeouts; expired credentials; transient network drops on live trading nodes.
Understand the failure class
Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.
Related errors
- get_open_orders failed: {e}
- Failed to get open orders: {error_msg}
- Failed to fetch CFM balance summary: {e}
- Failed to fetch CFM positions: {e}
- Failed to fetch CFM position '{product_id}': {e}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/5ff112c7eb23f491.
Report an issue: GitHub.