nautechsystems/nautilus_trader · error · anyhow::Error
fill report start time must not exceed end time
Error message
fill report start time must not exceed end time
What it means
Raised in generate_fill_reports when the requested fill-report query window is inverted: the command's start time (converted to milliseconds) is greater than the end time (either the provided end or 'now'). NautilusTrader validates the window before querying user trades so it never issues a guaranteed-empty/invalid Binance userTrades request.
Solutions
- Ensure cmd.start <= cmd.end (or <= current time when end is omitted) in the mass status request.
- Swap or correct the start/end arguments if they were reversed.
- Synchronize the machine clock (NTP) if the start time appears valid but is after the node's now.
- Validate the timestamp range in the calling tool/script before issuing the request.
Example fix
// before let cmd = GenerateFillReports::new(None, start_ms, end_ms); // start_ms > end_ms // after assert!(start_ms <= end_ms, "start must not exceed end"); let cmd = GenerateFillReports::new(None, start_ms, end_ms);
Defensive patterns
Strategy: validation
Validate before calling
let now_ms = clock.get_time_ns().as_i64() / 1_000_000;
let start_ms = start.as_i64() / 1_000_000;
let end_ms = end.map(|e| e.as_i64() / 1_000_000).unwrap_or(now_ms);
if start_ms > end_ms {
return Err("fill report start must not exceed end");
} Prevention
- Check start <= end before issuing mass status requests
- Synchronize clocks via NTP to avoid now < start
- Validate user-supplied dates in tooling that builds commands
When it happens
Trigger: Calling generate_mass_status (or the fill report path) with cmd.start later than cmd.end, or with a start time in the future relative to the node clock so that start_ms > now_ms when no explicit end is given.
Common situations: A user passes reversed start/end dates to a mass status request; clock skew makes the node's 'now' earlier than the requested start; timezone/date parsing errors in tooling that builds the command.
Understand the failure class
Background: "Invalid query parameter" / "Failed to parse value of ...": fixing bad query string parameters across APIs — this error's family across 36 libraries.
Related errors
- Binance Futures fill report end time requires start time…
- Binance Futures fill report range is incomplete: start
- Binance Futures goodTillDate must be strictly greater than…
- Binance Futures trade limit must not exceed 1000
- Binance instrument filter
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/f634919fd759e50b.
Report an issue: GitHub.
Appendix: source
Thrown at crates/adapters/binance/src/futures/execution.rs:2462
"Dropping historical Binance Futures fills for unresolved instrument {instrument_id}"
);
}
return Ok(Vec::new());
};
let symbol = format_binance_symbol(&instrument_id);
let mut trades = Vec::new();
let mut seen_trade_ids = AHashSet::new();
let requested_end_time = cmd
.end
.map(|end| end.as_i64() / NANOSECONDS_IN_MILLISECOND as i64);
if let Some(start) = cmd.start {
let query_start_time = start.as_i64() / NANOSECONDS_IN_MILLISECOND as i64;
let query_end_time = requested_end_time.unwrap_or_else(|| {
self.clock.get_time_ns().as_i64() / NANOSECONDS_IN_MILLISECOND as i64
});
anyhow::ensure!(
query_start_time <= query_end_time,
"fill report start time must not exceed end time"
);
let complete_start = user_trades_complete_start(cmd.ts_init, self.clock.get_time_ns());
anyhow::ensure!(
start >= complete_start,
"Binance Futures fill report range is incomplete: start {start} precedes complete-history boundary {complete_start}"
);
let mut window_start = query_start_time;
loop {
let window_end = window_start
.saturating_add(USER_TRADES_MAX_INTERVAL_MS)
.min(query_end_time);
let mut from_id = None;
loop {
let mut builder = BinanceUserTradesParamsBuilder::default();View on GitHub (pinned to 18893faf8b)