{"record":{"id":"525e1517613c29cc","repo":"nautechsystems/nautilus_trader","slug":"no-aggregator-for-continuous-future-request-reque","errorCode":null,"errorMessage":"No aggregator for continuous future request {request_id}","messagePattern":"No aggregator for continuous future request (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/data/src/engine/mod.rs","lineNumber":1568,"sourceCode":"        self.apply_continuous_future_adjustment(request_id, &state.request, segment.index)?;\n        let child = self.build_continuous_future_child_request(request_id, &state, segment);\n        if let Some(active) = self.continuous_future_requests.get_mut(&request_id) {\n            active.cursor_ns = UnixNanos::from(segment.end_ns.saturating_add(1));\n        }\n\n        self.dispatch_request_to_client(child).map(|_| ())\n    }\n\n    fn apply_continuous_future_adjustment(\n        &self,\n        request_id: UUID4,\n        request: &ContinuousFutureRequest,\n        segment_index: usize,\n    ) -> anyhow::Result<()> {\n        let adjustment = request.adjustment_for_segment(segment_index);\n        let key = bar_aggregator_key(request.primary_bar_type, Some(request_id));\n        let aggregator = self.bar_aggregators.get(&key).ok_or_else(|| {\n            anyhow::anyhow!(\"No aggregator for continuous future request {request_id}\")\n        })?;\n        aggregator\n            .borrow_mut()\n            .set_adjustment(adjustment, request.adjustment_mode);\n\n        Ok(())\n    }\n\n    fn build_continuous_future_child_request(\n        &self,\n        request_id: UUID4,\n        state: &ContinuousFutureRequestState,\n        segment: ContinuousFutureSegment,\n    ) -> RequestCommand {\n        let source = state.request.source_for_segment(segment.instrument_id);\n        let start = Some(UnixNanos::from(segment.start_ns).to_datetime_utc());\n        let end = Some(UnixNanos::from(segment.end_ns).to_datetime_utc());\n        let child_params = Some(","sourceCodeStart":1550,"sourceCodeEnd":1586,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/data/src/engine/mod.rs#L1550-L1586","documentation":"When processing a continuous futures request segment, the engine looks up the bar aggregator registered under the request's primary bar type (`bar_aggregator_key`) to apply the price adjustment for that segment. If no aggregator exists under that key, this error is returned. It is an internal consistency error: a continuous future request is being handled without its corresponding aggregator having been created/registered.","triggerScenarios":"Calling `_handle_continuous_future`-style processing (setting adjustment for segment `segment_index` of `request_id`) when the aggregator map has no entry for `(primary_bar_type, request_id)` — e.g. the aggregator was never created because the initial subscription/request setup failed or was skipped, or it was removed/cleaned up before segment processing, or the bar type in the request doesn't match the one used at aggregator creation (aggregation mismatch such as step vs tick aggregation).","commonSituations":"Requesting continuous futures data with a bar type/aggregation spec that differs from the one the aggregator was created with; teardown of the subscription between the initial request and the adjustment update; internal state corruption after a failed prior request left partial registration.","solutions":["Ensure the continuous future request goes through the standard request path that first creates and registers the bar aggregator for the primary bar type before segment adjustment runs.","Verify the bar type in the request (step size, aggregation source, price/instrument type) exactly matches the one used when the aggregator was registered — fix the request spec.","Check logs for a prior failure or unsubscribe that removed the aggregator for this request_id and reissue the full request.","If reproducible with a consistent request, report as an internal invariant violation with the request parameters, since callers normally cannot hit this path."],"exampleFix":"// before: requesting continuous futures with a bar_type that never got an aggregator\nlet request = ContinuousFutureRequest::new(bar_type_with_step_1min, ...);\n\n// after: use the same bar type spec the aggregator was registered with\nlet request = ContinuousFutureRequest::new(registered_primary_bar_type, ...);","handlingStrategy":"try-catch","validationCode":"# Caller-side: confirm the request's bar type matches an existing aggregator registration\nkey = (request.primary_bar_type, request_id)\nif key not in engine.bar_aggregators:\n    logger.warning(f\"no aggregator for {request_id} with bar type {request.primary_bar_type}; reissuing full request\")\n    engine.recreate_continuous_future_request(request)  # full request path re-registers the aggregator","typeGuard":null,"tryCatchPattern":"match engine.set_continuous_future_adjustment(request_id, segment_index) {\n    Ok(()) => {}\n    Err(e) if e.to_string().starts_with(\"No aggregator for continuous future request\") => {\n        // aggregator was never registered or was torn down; restart the request from scratch\n        warn!(\"aggregator missing for {request_id}; reissuing full continuous future request\");\n        engine.handle_continuous_future_request(request)?;\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Always create continuous future requests through the full official request path so the aggregator is registered before segment processing.","Keep the primary bar type (step, aggregation source) identical across the lifetime of a request ID; don't mutate specs mid-request.","Avoid unsubscribing/tearing down a request while segment updates are still pending.","If this error appears with consistent inputs, capture the request parameters and report it — it indicates broken internal engine state."],"tags":["data-engine","continuous-futures","bar-aggregator","internal-state"],"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"}