{"record":{"id":"35fdfae4a5896a00","repo":"nautechsystems/nautilus_trader","slug":"venue-not-found-for-exchange-exchange-e-35fdfa","errorCode":null,"errorMessage":"Venue not found for exchange {exchange}: {e}","messagePattern":"Venue not found for exchange (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/databento/src/loader.rs","lineNumber":285,"sourceCode":"                        .get::<InstrumentDefMsg>()\n                        .ok_or_else(|| anyhow::anyhow!(\"Failed to decode InstrumentDefMsg\"))?;\n\n                    let raw_symbol = rec\n                        .raw_symbol()\n                        .map_err(|e| anyhow::anyhow!(\"Error decoding `raw_symbol`: {e}\"))?;\n                    let symbol = Symbol::from(raw_symbol);\n\n                    let publisher = rec\n                        .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)","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/databento/src/loader.rs#L267-L303","documentation":"After extracting the exchange code for a GLBX.MDP3 record, the loader converts it to a Nautilus `Venue` via `Venue::from_code`. If that exchange code is not a known venue the conversion error is re-raised with the exchange value embedded.","triggerScenarios":"GLBX.MDP3 definition records whose exchange code (e.g. a new or unusual CME group exchange) has no corresponding registered `Venue` in the loader's `Venue::from_code` mapping.","commonSituations":"Databento adds a new exchange code after the installed nautilus version was released; loading data from an exotic market within GLBX that the venue registry does not cover.","solutions":["Upgrade NautilusTrader to a version whose venue registry knows the exchange code","Check the error's embedded exchange string and register/patch the venue mapping if running a custom build","Pass `use_exchange_as_venue = false` to use the publisher-based venue mapping instead","Confirm the dataset is GLBX; if the data is from another dataset the exchange codes may be foreign"],"exampleFix":"// before\nlet venue = Venue::from_code(exchange).map_err(|e| anyhow::anyhow!(\"Venue not found for exchange {exchange}: {e}\"))?;\n// after\nlet venue = Venue::from_code(exchange).unwrap_or_else(|_| Venue::from_code(\"GLBX\")); // graceful fallback to canonical GLBX venue","handlingStrategy":"fallback","validationCode":"// pre-check that every exchange code you expect is a known venue\nfor code in expected_exchange_codes {\n    assert!(Venue::from_code(code).is_ok(), \"unknown venue code: {code}\");\n}","typeGuard":null,"tryCatchPattern":"let venue = Venue::from_code(exchange).unwrap_or(VENUE_GLBX); // or map to a default venue on failure","preventionTips":["Keep NautilusTrader updated so new exchange codes are registered","Check Databento release notes for new GLBX exchange codes before ingesting","Fall back to publisher-based venue mapping for unfamiliar exchanges"],"tags":["databento","venue-mapping","enum-conversion"],"backgroundTag":"invalid-enum-value","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"}