{"record":{"id":"f3104bdf5393cf8e","repo":"nautechsystems/nautilus_trader","slug":"venue-not-found-for-publisher-id","errorCode":null,"errorMessage":"Venue not found for publisher_id {}","messagePattern":"Venue not found for publisher_id (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/databento/src/loader.rs","lineNumber":294,"sourceCode":"                        .hd\n                        .publisher()\n                        .map_err(|e| anyhow::anyhow!(\"Invalid `publisher` for record: {e}\"))?;\n                    let venue = match publisher {\n                        Publisher::GlbxMdp3Glbx if use_exchange_as_venue => {\n                            let exchange = rec.exchange().map_err(|e| {\n                                anyhow::anyhow!(\"Missing `exchange` for record: {e}\")\n                            })?;\n                            let venue = Venue::from_code(exchange).map_err(|e| {\n                                anyhow::anyhow!(\"Venue not found for exchange {exchange}: {e}\")\n                            })?;\n                            self.symbol_venue_map.insert(symbol, venue);\n                            venue\n                        }\n                        _ => *self\n                            .publisher_venue_map\n                            .get(&msg.hd.publisher_id)\n                            .ok_or_else(|| {\n                                anyhow::anyhow!(\n                                    \"Venue not found for publisher_id {}\",\n                                    msg.hd.publisher_id\n                                )\n                            })?,\n                    };\n                    let instrument_id = InstrumentId::new(symbol, venue);\n                    let ts_init = msg.ts_recv.into();\n\n                    decode_instrument_def_msg(rec, instrument_id, Some(ts_init), decode_config)\n                })();\n\n                match result {\n                    Ok(Some(item)) => return Some(Ok(item)),\n                    Ok(None) => {}\n                    Err(e) => return Some(Err(e)),\n                }\n            }\n        }))","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/databento/src/loader.rs#L276-L312","documentation":"When the publisher is not GLBX.MDP3 (or exchange-as-venue is disabled), the venue is looked up in the loader's `publisher_venue_map` by `msg.hd.publisher_id`. A missing entry means the caller did not configure a venue for that Databento publisher.","triggerScenarios":"Calling `read_definition_records`/`load_instruments` with a `publisher_venue_map` that lacks an entry for the publisher_id present in the records (e.g. OPRA, XNAS, EQUS publishers not mapped).","commonSituations":"Loading non-futures datasets (equities, options) while only configuring the default GLBX mapping; typos in publisher enum used to build the map.","solutions":["Add the missing publisher-to-venue entry to `publisher_venue_map` when constructing `DatabentoInstrumentLoader`","Check `msg.hd.publisher_id` in the error message and map that exact publisher (e.g. `Publisher::Xnas::..., Venue::NASDAQ`)","Use the standard `get_publisher_venue_map`/default mappings from the adapter rather than a hand-built map","Upgrade the adapter if the publisher is a newly added Databento publisher"],"exampleFix":"// before\nlet loader = DatabentoInstrumentLoader::new(\n    HashMap::from([(Publisher::GlbxMdp3Glbx, Venue::from_code(\"GLBX\"))]),\n    true,\n);\n// after\nlet loader = DatabentoInstrumentLoader::new(\n    HashMap::from([\n        (Publisher::GlbxMdp3Glbx, Venue::from_code(\"GLBX\")),\n        (Publisher::Opra, Venue::from_code(\"OPRA\")),\n    ]),\n    true,\n);","handlingStrategy":"validation","validationCode":"// ensure every publisher in the dataset has a venue mapping before loading\nfor pub_id in expected_publishers {\n    assert!(publisher_venue_map.contains_key(&pub_id), \"no venue for {pub_id:?}\");\n}","typeGuard":null,"tryCatchPattern":"match loader.load_instruments(file) {\n    Ok(i) => i,\n    Err(e) if e.to_string().contains(\"Venue not found for publisher_id\") => {\n        let id: u16 = /* parse from message */ 0;\n        let publisher = Publisher::try_from(id)?;\n        anyhow::bail!(\"add a venue mapping for publisher {publisher:?} to publisher_venue_map\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Build `publisher_venue_map` from the adapter's standard/default mapping helpers","Map publishers for every dataset you ingest (GLBX, OPRA, XNAS, EQUS, ...), not just futures","Read the publisher_id in the error message; it names exactly which entry is missing"],"tags":["databento","venue-mapping","configuration"],"backgroundTag":"missing-required-config-field","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"}