{"record":{"id":"cdca51beef0b2ccc","repo":"nautechsystems/nautilus_trader","slug":"no-live-aggregator-for-continuous-future-subscript","errorCode":null,"errorMessage":"No live aggregator for continuous future subscription {}","messagePattern":"No live aggregator for continuous future subscription (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/data/src/engine/mod.rs","lineNumber":5421,"sourceCode":"            ts_init,\n            true,\n        );\n\n        if let Some(child) = sub_child {\n            self.execute(child);\n        }\n\n        self.schedule_continuous_future_transition(target_key);\n    }\n\n    fn apply_continuous_future_subscription_adjustment(\n        &self,\n        request: &ContinuousFutureRequest,\n        segment_index: usize,\n    ) -> anyhow::Result<()> {\n        let key = bar_aggregator_key(request.primary_bar_type, None);\n        let aggregator = self.bar_aggregators.get(&key).ok_or_else(|| {\n            anyhow::anyhow!(\n                \"No live aggregator for continuous future subscription {}\",\n                request.primary_bar_type\n            )\n        })?;\n        let adjustment = request.adjustment_for_segment(segment_index);\n        aggregator\n            .borrow_mut()\n            .set_adjustment(adjustment, request.adjustment_mode);\n        Ok(())\n    }\n\n    fn apply_continuous_future_subscription_adjustment_for(\n        &self,\n        target_bar_type: BarType,\n        segment_index: usize,\n    ) -> anyhow::Result<()> {\n        let Some(state) = self\n            .continuous_future_subscriptions","sourceCodeStart":5403,"sourceCodeEnd":5439,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/data/src/engine/mod.rs#L5403-L5439","documentation":"The data engine's continuous-future segment request handler looks up a live bar aggregator keyed by the request's primary bar type; the requested bar type has no registered aggregator. This is an ordering/invariant error: the caller is asking to continue building a continuous futures series for a bar type that was never subscribed or has since been unsubscribed.","triggerScenarios":"Calling the continuous-future segment handling path (with a ContinuousFutureRequest and segment_index) when self.bar_aggregators contains no entry for key(primary_bar_type) — i.e. no live aggregator was created for that bar type beforehand.","commonSituations":"Requesting continuous-future bars without a prior subscription for the primary bar type; aggregator deregistered by an unsubscribe between the initial subscribe and the segment request; a typo/mismatch in the BarType (step, aggregation, price type) so the lookup key differs from the registered one.","solutions":["Subscribe to the primary bar type first so the engine creates a live bar aggregator before issuing continuous-future segment requests.","Verify request.primary_bar_type exactly matches the subscribed BarType (instrument id, aggregation, step, price type).","Check that nothing unsubscribed or cleared bar aggregators between subscription and the request.","If this is intended to be optional, handle the missing-aggregator case upstream instead of letting the anyhow error propagate."],"exampleFix":"// before\nlet aggregator = self.bar_aggregators.get(&key).ok_or_else(|| {\n    anyhow::anyhow!(\"No live aggregator for continuous future subscription {}\", request.primary_bar_type)\n})?;\n// after\nlet aggregator = match self.bar_aggregators.get(&key) {\n    Some(a) => a,\n    None => {\n        log::warn!(\"no live aggregator for {}; skipping segment\", request.primary_bar_type);\n        return Ok(());\n    }\n};","handlingStrategy":"validation","validationCode":"// before issuing the continuous-future request, check the aggregator exists\nlet key = bar_aggregator_key(request.primary_bar_type, None);\nif !engine.bar_aggregators.contains_key(&key) {\n    // subscribe to request.primary_bar_type first or skip the request\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always subscribe to the primary bar type before requesting continuous-future segments.","Build BarTypes with a shared helper so lookup keys always match subscription keys.","Log aggregator registration/unregistration to trace lifecycle order."],"tags":["data-engine","bar-aggregation","subscription","rust"],"backgroundTag":"resource-not-found","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"}