{"record":{"id":"c486a4fa3a7489a0","repo":"nautechsystems/nautilus_trader","slug":"catalog-marker-join-load-failed-for-data-cls-e","errorCode":null,"errorMessage":"catalog marker join load failed for {data_cls}: {error}","messagePattern":"catalog marker join load failed for (.+?): (.+?)","errorType":"exception","errorClass":"EventStoreError::Backend","httpStatus":null,"severity":"error","filePath":"crates/event_store/src/markers/join.rs","lineNumber":180,"sourceCode":") -> Result<CatalogSliceCoverage, EventStoreError>\nwhere\n    C: ReplayCatalog + ?Sized,\n{\n    catalog\n        .plan_slice(query)\n        .map_err(|e| catalog_error(&query.data_cls, \"plan\", e))\n}\n\nfn load_slice<C>(\n    catalog: &mut C,\n    plan: &CatalogSlicePlan,\n) -> Result<Vec<CatalogReplayRecord>, EventStoreError>\nwhere\n    C: ReplayCatalog + ?Sized,\n{\n    catalog\n        .load_slice(plan)\n        .map_err(|e| catalog_error(&plan.query.data_cls, \"load\", e))\n}\n\nfn catalog_error(data_cls: &str, action: &str, error: impl Display) -> EventStoreError {\n    EventStoreError::Backend(format!(\n        \"catalog marker join {action} failed for {data_cls}: {error}\"\n    ))\n}\n\n#[cfg(test)]\nmod tests {\n    use nautilus_core::UnixNanos;\n    use nautilus_model::{\n        data::{Bar, BarType, QuoteTick, TradeTick},\n        enums::AggressorSide,\n        identifiers::{InstrumentId, TradeId},\n        types::{Price, Quantity},\n    };\n    use rstest::rstest;","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/event_store/src/markers/join.rs#L162-L198","documentation":"After a slice plan succeeds, `load_replayable_records` asks the catalog to load the planned slice (`load_slice`). Any backend failure during loading is converted into `EventStoreError::Backend` with 'catalog marker join load failed for {data_cls}: {error}', preserving the data class and underlying error for diagnosis.","triggerScenarios":"Calling `load_replayable_records` where planning succeeds but loading fails — storage I/O errors, missing/corrupt data files for the planned range, backend connection loss mid-load, or a custom `ReplayCatalog` whose `load_slice` returns an error.","commonSituations":"Replaying from a data catalog whose files were moved/deleted or are partially written; network interruptions to object-storage-backed catalogs; concurrent modification of catalog data during replay.","solutions":["Inspect the wrapped `{error}` to find the underlying load failure (I/O, missing files, connectivity)","Verify the planned data files/ranges exist and are readable at the catalog backend","Retry the replay if the failure was transient (connection loss, temporary unavailability)","Fix `load_slice` if this comes from a custom `ReplayCatalog` implementation"],"exampleFix":"// before: load errors abort the replay unguarded\nlet records = store.load_replayable_records(&query)?;\n// after: retry transient backend load failures\nlet records = match store.load_replayable_records(&query) {\n    Ok(r) => r,\n    Err(e) if e.is_transient() => {\n        backoff::retry(|| store.load_replayable_records(&query))?\n    }\n    Err(e) => return Err(e),\n};","handlingStrategy":"try-catch","validationCode":"// Plan first and check loadability is implied; at minimum pre-validate the range\nlet plan = catalog.plan_slice(&query).expect(\"plan\");\n// optionally probe a small slice first\nlet probe = catalog.load_slice(&plan.limit_to(1))?;","typeGuard":null,"tryCatchPattern":"match store.load_replayable_records(&query) {\n    Err(EventStoreError::Backend(msg)) if msg.contains(\"load failed\") => {\n        eprintln!(\"transient backend load failure, retrying: {msg}\");\n        // retry with backoff\n    }\n    Err(e) => return Err(e.into()),\n    Ok(records) => process(records),\n}","preventionTips":["Retry with backoff for transient backend/storage failures during replay","Ensure catalog data files for the replay range exist and are readable before starting","Avoid concurrent writes/moves of catalog data while a replay is running"],"tags":["rust","event-store","catalog","replay","backend"],"backgroundTag":"database-query-failed","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"}