{"record":{"id":"b6c0c0ab0e92df3b","repo":"nautechsystems/nautilus_trader","slug":"fill-group-is-empty","errorCode":null,"errorMessage":"fill group is empty","messagePattern":"fill group is empty","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/live/src/execution/manager.rs","lineNumber":1268,"sourceCode":"        }\n\n        log::info!(\n            color = LogColor::Blue as u8;\n            \"Reconciliation complete for {venue}: reconciled={orders_reconciled}, external={external_orders_created}, open={open_orders_initialized}, fills={fills_applied}, positions={positions_created}, skipped={orders_skipped_duplicate}, filtered={orders_skipped_filtered}\",\n        );\n\n        ReconciliationResult {\n            events,\n            external_orders,\n        }\n    }\n\n    fn create_orphan_fill_order_report(\n        fills: &[&FillReport],\n        instrument: &InstrumentAny,\n    ) -> anyhow::Result<OrderStatusReport> {\n        let Some(first) = fills.first() else {\n            anyhow::bail!(\"fill group is empty\");\n        };\n        let venue_position_id = first\n            .venue_position_id\n            .ok_or_else(|| anyhow::anyhow!(\"venue position ID is missing\"))?;\n\n        for fill in fills.iter().skip(1) {\n            anyhow::ensure!(\n                fill.account_id == first.account_id,\n                \"account ID differs across fill group\"\n            );\n            anyhow::ensure!(\n                fill.instrument_id == first.instrument_id,\n                \"instrument ID differs across fill group\"\n            );\n            anyhow::ensure!(\n                fill.venue_order_id == first.venue_order_id,\n                \"venue order ID differs across fill group\"\n            );","sourceCodeStart":1250,"sourceCodeEnd":1286,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/live/src/execution/manager.rs#L1250-L1286","documentation":"An internal invariant check in `create_orphan_fill_order_report`: the function requires a non-empty slice of `FillReport` references to synthesize an order status report for an orphan fill (a fill that arrived without a matching order). If the fill group is empty, the precondition is violated and it bails rather than fabricate a report.","triggerScenarios":"Internal call path groups orphan fills by (order key/venue) and calls this helper per group; an empty group reaching the helper indicates a bug in the grouping logic, not normal user-triggerable input.","commonSituations":"Encountered only via a live-execution bug or adapter anomaly where fill grouping produced an empty bucket; should never occur through normal API usage.","solutions":["Report the occurrence with logs to the nautilus_trader maintainers — it signals an internal bug in orphan fill handling.","Check your adapter for emitting malformed/empty fill batches that could confuse grouping.","As a mitigation, ensure fills are logged so the orphan fills can be reconciled manually against the venue."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Not user-fixable; log and report\nif let Err(e) = create_orphan_fill_order_report(&fills, &instrument) {\n    log::error!(\"internal orphan-fill failure: {e:#}\");\n    /* report bug to maintainers with logs */\n}","preventionTips":["Keep full fill logs enabled so orphan fills can be reconciled manually.","Report any occurrence to nautilus_trader maintainers — it indicates an internal bug.","Keep adapters updated to avoid malformed fill batches."],"tags":["internal","invariant","execution-engine","rust"],"backgroundTag":"internal-invariant-violation","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}