{"record":{"id":"ceed7c8bb55871f8","repo":"nautechsystems/nautilus_trader","slug":"error-decoding-raw-symbol-e","errorCode":null,"errorMessage":"Error decoding `raw_symbol`: {e}","messagePattern":"Error decoding `raw_symbol`: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/databento/src/loader.rs","lineNumber":272,"sourceCode":"            loop {\n                let advance = dbn_stream\n                    .advance()\n                    .map_err(|e| anyhow::anyhow!(\"Stream advance error: {e}\"));\n                if let Err(e) = advance {\n                    return Some(Err(e));\n                }\n\n                let rec = dbn_stream.get()?;\n\n                let result: anyhow::Result<Option<InstrumentAny>> = (|| {\n                    let record = dbn::RecordRef::from(rec);\n                    let msg = record\n                        .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","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/databento/src/loader.rs#L254-L290","documentation":"After successfully locating an InstrumentDefMsg, the adapter reads the record's `raw_symbol` field; if those bytes cannot be decoded into a valid string (bad UTF-8 or invalid length prefix), decoding fails and the definition is rejected with this error.","triggerScenarios":"During load_instruments/read_definition_records, a definition record contains a raw_symbol byte field that fails dbn decoding — corrupt file data, truncated record, or decoder/version layout mismatch.","commonSituations":"Corrupted or partially written DBN definition files, historical files decoded with an incompatible dbn crate version, custom tooling that rewrote records.","solutions":["Re-download the definition data from Databento and confirm the file's integrity before loading","Align the `databento-dbn` dependency version with the file's DBN version (upgrade the adapter and rebuild)","Validate the file with Databento's dbn tooling to confirm whether corruption is in the data or the adapter","Skip and log the offending record instead of failing the whole load if only isolated records are bad"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"for rec in loader.read_definition_records(&path, true, None)? {\n    match rec {\n        Ok(inst) => { /* use inst */ }\n        Err(e) if e.to_string().contains(\"Error decoding `raw_symbol`\") => {\n            log::warn!(\"bad record skipped: {e}\");\n        }\n        Err(e) => return Err(e),\n    }\n}","preventionTips":["Verify definition file integrity before loading","Use a databento-dbn version matching the file's DBN version","Treat isolated decode failures as data corruption; re-download the file"],"tags":["databento","dbn","decoding","utf-8"],"backgroundTag":"json-decode-failed","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"}