{"record":{"id":"712221aaba586bdf","repo":"nautechsystems/nautilus_trader","slug":"no-active-continuous-future-request-for-request-i","errorCode":null,"errorMessage":"No active continuous future request for {request_id}","messagePattern":"No active continuous future request for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/data/src/engine/mod.rs","lineNumber":1539,"sourceCode":"            anyhow::bail!(\n                \"Cannot request aggregated bars: one of the aggregators in `bar_types` is already running\"\n            );\n        }\n\n        self.request_bar_aggregations\n            .insert(request_id, state.clone());\n\n        if let Err(e) = self.init_request_bar_aggregators(request_id, state) {\n            self.cleanup_request_bar_aggregators(&request_id);\n            return Err(e);\n        }\n\n        Ok(())\n    }\n\n    fn dispatch_next_continuous_future_segment(&mut self, request_id: UUID4) -> anyhow::Result<()> {\n        let Some(state) = self.continuous_future_requests.get(&request_id).cloned() else {\n            anyhow::bail!(\"No active continuous future request for {request_id}\");\n        };\n\n        let Some(segment) = state\n            .request\n            .next_segment(state.cursor_ns.as_u64(), state.end_ns.as_u64())\n        else {\n            self.emit_empty_continuous_future_response(request_id);\n            return Ok(());\n        };\n\n        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    }","sourceCodeStart":1521,"sourceCodeEnd":1557,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/data/src/engine/mod.rs#L1521-L1557","documentation":"dispatch_next_continuous_future_segment looks up the active continuous future request state by request_id; if the map contains no entry for that UUID4, the engine bails because it cannot continue segmenting a request it does not know about.","triggerScenarios":"Calling dispatch_next_continuous_future_segment with a request_id that never registered via execute_continuous_future_request, or after the continuous-future request state was already consumed/completed/removed.","commonSituations":"Calling internal dispatch from custom code with a stale or wrong request ID; continuing pagination after the continuous request finished and its state was deleted; two components racing where one completes and cleans up the request before the other dispatches.","solutions":["Verify the request_id passed matches the UUID4 returned from the original continuous bars request","Only call dispatch_next_continuous_future_segment while the continuous request is still active (not after final segment completion)","Re-issue the original continuous bars request if its state has already been consumed","Check for double-completion logic in custom code that might remove the state before a second dispatch"],"exampleFix":"// before\nengine.dispatch_next_continuous_future_segment(stale_request_id);\n// after\nengine.request_bars(continuous_bars_req); // re-issue to obtain fresh request_id\nengine.dispatch_next_continuous_future_segment(fresh_request_id);","handlingStrategy":"validation","validationCode":"// only dispatch while the request state still exists\nif engine.get_continuous_future_request(&request_id).is_none() {\n    log::warn!(\"continuous request {request_id} already completed\");\n    return Ok(());\n}","typeGuard":null,"tryCatchPattern":"match engine.dispatch_next_continuous_future_segment(request_id) {\n    Err(e) if e.to_string().contains(\"No active continuous future request\") => {\n        log::warn!(\"request {request_id} no longer active; re-issue if needed\");\n    }\n    other => other?,\n}","preventionTips":["Keep the original request_id from execute_continuous_future_request","Do not dispatch segments after the final segment completes","Serialize dispatch calls to avoid one component cleaning up before another dispatches"],"tags":["rust","data-engine","continuous-futures","state-management"],"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"}