{"record":{"id":"fff9e2af82cf9b14","repo":"nautechsystems/nautilus_trader","slug":"failed-to-fetch-fills-e","errorCode":null,"errorMessage":"Failed to fetch fills: {e}","messagePattern":"Failed to fetch fills: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/coinbase/src/http/client.rs","lineNumber":1265,"sourceCode":"        instrument_id: Option<InstrumentId>,\n        venue_order_id: Option<VenueOrderId>,\n        start: Option<Timestamp>,\n        end: Option<Timestamp>,\n        limit: Option<u32>,\n    ) -> anyhow::Result<Vec<FillReport>> {\n        let query = FillListQuery {\n            product_id: instrument_id.map(|id| id.symbol.as_str().to_string()),\n            venue_order_id: venue_order_id.map(|id| id.as_str().to_string()),\n            start,\n            end,\n            limit,\n        };\n\n        let fills = self\n            .inner\n            .fetch_all_fills(&query)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"Failed to fetch fills: {e}\"))?;\n\n        let ts_init = self.ts_now();\n        let mut reports = Vec::with_capacity(fills.len());\n\n        for fill in &fills {\n            let instrument = match self.get_or_fetch_instrument(fill.product_id).await {\n                Ok(inst) => inst,\n                Err(e) => {\n                    log::debug!(\"Skipping fill {}: {e}\", fill.trade_id);\n                    continue;\n                }\n            };\n\n            match parse_fill_report(fill, &instrument, account_id, ts_init) {\n                Ok(report) => reports.push(report),\n                Err(e) => log::warn!(\"Failed to parse fill {}: {e}\", fill.trade_id),\n            }\n        }","sourceCodeStart":1247,"sourceCodeEnd":1283,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/coinbase/src/http/client.rs#L1247-L1283","documentation":"This error wraps any failure from `fetch_all_fills` — the paginated Coinbase fill (execution) history endpoint — while building fill reports. It means the HTTP/API call for trade history failed (network, auth, invalid query params, rate limiting). It is thrown because execution reports cannot be generated without the fills list.","triggerScenarios":"Calling the fills-report method at client.rs:1265 with a fills query whose paginated `fetch_all_fills` call fails: invalid product_id filter, out-of-range start/end window, 401 auth, 429 rate limit, network interruption mid-pagination.","commonSituations":"Backfilling execution history for reconciliation with an invalid time window; querying fills with a misformatted product id; credential rotation invalidating keys mid-run; rate limits when paginating deep fill history.","solutions":["Inspect the inner error chain for the root cause (HTTP status, Coinbase message).","Validate the product_id filter format (BTC-USDT style) and the start/end window.","Verify API key permissions include fill/trade history access.","Retry transient errors (timeouts, 5xx, 429) with backoff and resume pagination from the last cursor.","Narrow the queried time window or paginate in smaller chunks."],"exampleFix":"// before: one-shot deep history pull\nlet reports = client.request_fill_status_reports(account_id, None, None, None).await?;\n// after: chunked windows to avoid rate limits\nfor (start, end) in chunk_days(requested_start, requested_end, 7) {\n    let reports = client.request_fill_status_reports(account_id, None, Some(start), Some(end)).await?;\n    process(reports);\n}","handlingStrategy":"retry","validationCode":"if let (Some(s), Some(e)) = (start, end) {\n    assert!(e > s, \"fill query end must be after start\");\n}","typeGuard":null,"tryCatchPattern":"match client.request_fill_status_reports(account_id, instrument_id, start, end).await {\n    Ok(reports) => reports,\n    Err(e) if is_retryable(&e) => retry_with_backoff(3, Duration::from_secs(1), || {\n        client.request_fill_status_reports(account_id, instrument_id, start, end)\n    }).await?,\n    Err(e) => { tracing::error!(\"fetch fills failed: {e}\"); return Err(e); }\n}","preventionTips":["Use Coinbase-format product ids for filters.","Query fills in bounded time windows rather than unbounded history.","Check key scope for fill history before large backfills.","Honor rate-limit headers during pagination."],"tags":["network","http","coinbase","pagination","fills"],"backgroundTag":"api-request-failed","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}