{"record":{"id":"a7f471c3c96e7c80","repo":"nautechsystems/nautilus_trader","slug":"continuous-future-first-pre-instrument-id-instrum","errorCode":null,"errorMessage":"Continuous future first_pre_instrument_id {instrument_id} was not found in transitions","messagePattern":"Continuous future first_pre_instrument_id (.+?) was not found in transitions","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/data/src/engine/requests.rs","lineNumber":407,"sourceCode":"        LAST_POST_INSTRUMENT_ID,\n        primary_bar_type.instrument_id(),\n    )?;\n    let transitions = parse_transitions(\n        primary_bar_type,\n        transitions_value,\n        adjustment_mode.is_ratio(),\n    )?;\n\n    if transitions.is_empty() {\n        anyhow::bail!(\"Continuous future transitions must not be empty\");\n    }\n\n    if let Some(instrument_id) = first_pre_instrument_id\n        && !transitions\n            .iter()\n            .any(|row| row.pre_instrument_id == instrument_id)\n    {\n        anyhow::bail!(\n            \"Continuous future first_pre_instrument_id {instrument_id} was not found in transitions\"\n        );\n    }\n\n    if let Some(instrument_id) = last_post_instrument_id\n        && !transitions\n            .iter()\n            .any(|row| row.post_instrument_id == instrument_id)\n    {\n        anyhow::bail!(\n            \"Continuous future last_post_instrument_id {instrument_id} was not found in transitions\"\n        );\n    }\n\n    Ok(ContinuousFutureRequest {\n        primary_bar_type,\n        request_bar_aggregation: RequestBarAggregation {\n            bar_types,","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/data/src/engine/requests.rs#L389-L425","documentation":"When building a continuous-future bar request/subscription, an optional `first_pre_instrument_id` chain bound was supplied that does not match the `pre_instrument_id` of any transition row in the parsed transition table. The library validates that every explicit chain boundary actually exists among the transitions so the continuous series cannot be anchored to a nonexistent contract.","triggerScenarios":"Calling continuous_future_request_from_bars or continuous_future_subscription_from_bars with a `first_pre_instrument_id` request parameter whose instrument ID does not equal any row's `pre_instrument_id` in the `transitions` parameter.","commonSituations":"Typo in the contract symbol passed as the chain start; using the expiry-month root (e.g. ESZ5) instead of the exact pre-transition contract listed in the transitions table; transitions regenerated after a data refresh while the client still passes an old bound; copying a bound from a different continuous series or data source.","solutions":["Set `first_pre_instrument_id` to exactly the `pre_instrument_id` of the first transition row (verify capitalization and expiry code).","Omit the `first_pre_instrument_id` parameter entirely to let the series start at the first transition.","Regenerate or re-fetch the `transitions` table so it contains the bound you are passing.","Log/inspect the parsed transitions (pre_instrument_id values) and diff against the requested bound."],"exampleFix":"// before\nlet params = json!({\"transitions\": rows, \"first_pre_instrument_id\": \"ESZ5\"});\n// after\nlet params = json!({\"transitions\": rows, \"first_pre_instrument_id\": \"ESZ5-CME\"}); // exact pre_instrument_id from transitions[0]","handlingStrategy":"validation","validationCode":"// Rust, before building request\nif let Some(bound) = &params.first_pre_instrument_id {\n    assert!(transitions.iter().any(|t| &t.pre_instrument_id == bound),\n        \"first_pre_instrument_id {bound} not in transitions\");\n}","typeGuard":"fn bound_in_transitions(bound: &InstrumentId, transitions: &[Transition]) -> bool {\n    transitions.iter().any(|t| t.pre_instrument_id == *bound)\n}","tryCatchPattern":null,"preventionTips":["Copy chain bounds directly from the transitions table, never from memory","Omit optional bounds unless you specifically need a partial chain","Diff bounds against parsed transitions in tests"],"tags":["validation","continuous-futures","request-params"],"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"}