{"record":{"id":"671a031ae9a7174e","repo":"nautechsystems/nautilus_trader","slug":"catalog-catalog-name-disappeared-between-timesta","errorCode":null,"errorMessage":"Catalog {catalog_name} disappeared between timestamp query and read","messagePattern":"Catalog (.+?) disappeared between timestamp query and read","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/data/src/engine/streaming.rs","lineNumber":556,"sourceCode":"        let identifier = cmd.instrument_id.to_string();\n        let Some(catalog_name) = self.catalog_with_last_timestamp(\"instruments\", &identifier)?\n        else {\n            return self\n                .dispatch_request_to_client(RequestCommand::Instrument(cmd))\n                .map(|_| ());\n        };\n\n        let now_ns = self.clock.borrow().timestamp_ns();\n        let used_client_id = self\n            .get_client(cmd.client_id.as_ref(), Some(&cmd.instrument_id.venue))\n            .map(|client| client.client_id());\n        let (start_dt, end_dt) =\n            bound_request_dates(cmd.start, cmd.end, now_ns.to_datetime_utc(), true);\n        let start_ns = datetime_to_unix_nanos_or_zero(start_dt);\n        let end_ns = datetime_to_unix_nanos_or_zero(end_dt);\n        let query_end = cmd.end.map(datetime_to_unix_nanos_or_zero);\n        let catalog = self.catalogs.get(&catalog_name).ok_or_else(|| {\n            anyhow::anyhow!(\"Catalog {catalog_name} disappeared between timestamp query and read\")\n        })?;\n        let mut data = catalog.instruments(\n            Some(std::slice::from_ref(&identifier)),\n            Some(start_ns),\n            query_end,\n        )?;\n        data = latest_instruments(data);\n\n        if let Some(instrument) = data.into_iter().next() {\n            let response = DataResponse::Instrument(Box::new(InstrumentResponse::new(\n                cmd.request_id,\n                resolve_response_client_id(cmd.client_id, used_client_id),\n                cmd.instrument_id,\n                instrument,\n                Some(start_ns),\n                Some(end_ns),\n                now_ns,\n                Some(catalog_response_params(cmd.params.as_ref())),","sourceCodeStart":538,"sourceCodeEnd":574,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/data/src/engine/streaming.rs#L538-L574","documentation":"dispatch_instrument_request resolves a catalog by name after computing the timestamp bounds for an instrument query; if the named catalog is no longer registered in self.catalogs, the engine raises this error. It guards against serving instrument data from an unexpected or half-torn-down catalog.","triggerScenarios":"Calling dispatch_instrument_request (via dispatch_instrument_catalog_request) when self.catalogs.get(&catalog_name) returns None — the catalog was never registered under that exact name or was removed between the earlier timestamp query and the read.","commonSituations":"Instrument catalog request issued with a misspelled or renamed catalog; catalog deregistered concurrently by another actor; request replayed after engine shutdown cleared registered catalogs.","solutions":["Verify the catalog_name in the instrument request matches a registered catalog exactly.","Re-register the catalog before dispatching instrument requests.","Avoid deregistering/closing catalogs while instrument requests may be in flight.","Validate the catalog exists once at request intake and fail fast with a clear message before doing timestamp work."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// resolve the catalog once before computing bounds / dispatching\nlet catalog = engine.catalogs.get(&catalog_name)\n    .ok_or_else(|| anyhow::anyhow!(\"catalog {catalog_name} not registered\"))?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate catalog_name against registered catalogs at request intake.","Avoid renaming or removing catalogs while instrument requests may be pending.","Use a single source of truth for catalog names (constants/config) instead of string literals."],"tags":["catalog","instruments","streaming","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-14T00:17:10.932Z"}