{"record":{"id":"950a5cac9e395337","repo":"nautechsystems/nautilus_trader","slug":"venue-not-found-for-publisher-id-publisher-id","errorCode":null,"errorMessage":"`Venue` not found for `publisher_id` {publisher_id}","messagePattern":"`Venue` not found for `publisher_id` (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/databento/src/symbology.rs","lineNumber":84,"sourceCode":"/// # Errors\n///\n/// Returns an error if:\n/// - The publisher cannot be extracted from the record.\n/// - The publisher ID is not found in the venue map.\n/// - The underlying instrument ID mapping fails.\npub fn decode_nautilus_instrument_id(\n    record: &dbn::RecordRef,\n    metadata: &mut MetadataCache,\n    publisher_venue_map: &IndexMap<PublisherId, Venue>,\n    symbol_venue_map: &AHashMap<Symbol, Venue>,\n) -> anyhow::Result<InstrumentId> {\n    let publisher = record\n        .publisher()\n        .map_err(|e| anyhow::anyhow!(\"Invalid `publisher` for record: {e}\"))?;\n    let publisher_id = publisher as PublisherId;\n    let venue = publisher_venue_map\n        .get(&publisher_id)\n        .ok_or_else(|| anyhow::anyhow!(\"`Venue` not found for `publisher_id` {publisher_id}\"))?;\n    let mut instrument_id = get_nautilus_instrument_id_for_record(record, metadata, *venue)?;\n\n    if publisher == Publisher::GlbxMdp3Glbx\n        && let Some(venue) = symbol_venue_map.get(&instrument_id.symbol)\n    {\n        instrument_id.venue = *venue;\n    }\n\n    Ok(instrument_id)\n}\n\n/// Gets the Nautilus `InstrumentId` for a Databento record.\n///\n/// # Errors\n///\n/// Returns an error if:\n/// - The record type is not supported.\n/// - Timestamp overflow occurs when calculating the date.","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/databento/src/symbology.rs#L66-L102","documentation":"After decoding the record's publisher ID, decode_nautilus_instrument_id looks the publisher up in the loader's publisher_venue_map to find the Nautilus Venue. If no Venue mapping is registered for that publisher ID, mapping the record to a Nautilus instrument is impossible and this error is thrown. It is a configuration gap, not a data corruption issue.","triggerScenarios":"Decoding records from a publisher ID (dataset) that is not in the loader's publisher_venue_map — e.g. data from a dataset whose Databento venue mapping was never registered because `with_publisher_venue_map` / the default map predates that publisher, or a custom map omitted an entry.","commonSituations":"Using a custom publisher→Venue map that omits newer Databento datasets (e.g. new equities/options datasets); data files from datasets other than the configured ones; adapter version too old to include the mapping for a newly released publisher.","solutions":["Add the missing PublisherId → Venue entry to the publisher_venue_map when configuring the loader (or use the adapter's default/builder that covers all supported publishers).","Upgrade the nautilus databento adapter so the built-in publisher map includes the new publisher.","Confirm the dataset/publisher of the file you are reading is actually supported, and use the matching dataset when requesting data."],"exampleFix":"// before\nlet mut loader = DatabentoDataLoader::new();\n\n// after\nlet mut loader = DatabentoDataLoader::new();\nloader.set_publisher_venue_map(my_map_with_publisher(1234, Venue::from(\"XCME\")));","handlingStrategy":"validation","validationCode":"// Rust\nlet publisher_id = record.publisher()? as PublisherId;\nanyhow::ensure!(\n    publisher_venue_map.contains_key(&publisher_id),\n    \"no Venue mapping for publisher {publisher_id}; register it before decoding\"\n);","typeGuard":null,"tryCatchPattern":"let venue = publisher_venue_map.get(&publisher_id).copied();\nif venue.is_none() {\n    log::warn!(\"unknown publisher {publisher_id}; record skipped\");\n    return Ok(None);\n}","preventionTips":["Use the adapter's default publisher→Venue map and extend it for new datasets","After adapter upgrades, re-check that all datasets you use are in the map","Fail fast at startup: verify every dataset you plan to load has a venue mapping"],"tags":["databento","rust","venue","publisher","mapping"],"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"}