{"record":{"id":"754c0355ca940df7","repo":"nautechsystems/nautilus_trader","slug":"invalid-schema-dbn-schema","errorCode":null,"errorMessage":"Invalid schema {dbn_schema}","messagePattern":"Invalid schema (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/databento/src/historical.rs","lineNumber":468,"sourceCode":"                    process_record(dbn::RecordRef::from(msg))?;\n                }\n            }\n            dbn::Schema::Bbo1M => {\n                while let Some(msg) = decoder.decode_record::<dbn::Bbo1MMsg>().await? {\n                    process_record(dbn::RecordRef::from(msg))?;\n                }\n            }\n            dbn::Schema::Bbo1S => {\n                while let Some(msg) = decoder.decode_record::<dbn::Bbo1SMsg>().await? {\n                    process_record(dbn::RecordRef::from(msg))?;\n                }\n            }\n            dbn::Schema::Cbbo1S | dbn::Schema::Cbbo1M => {\n                while let Some(msg) = decoder.decode_record::<dbn::CbboMsg>().await? {\n                    process_record(dbn::RecordRef::from(msg))?;\n                }\n            }\n            _ => anyhow::bail!(\"Invalid schema {dbn_schema}\"),\n        }\n\n        Ok(result)\n    }\n\n    /// Fetches order book depth10 snapshots for the given parameters.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the API request or data processing fails.\n    pub async fn get_range_order_book_depth10(\n        &self,\n        params: RangeQueryParams,\n        depth: Option<usize>,\n    ) -> anyhow::Result<Vec<OrderBookDepth10>> {\n        let symbols: Vec<&str> = params.symbols.iter().map(String::as_str).collect();\n        check_consistent_symbology(&symbols)?;\n","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/databento/src/historical.rs#L450-L486","documentation":"`get_range_quotes` dispatches record decoding per schema (mbp-1, tbbo/tcbbo, bbo, cmbp-1, cbbo). The catch-all arm bails when a schema slipped past the earlier validation but has no decode branch — a defensive internal invariant guard indicating the two schema checks in the method are out of sync.","triggerScenarios":"A `dbn::Schema` value that passed the allow-list check at the top of `get_range_quotes` but reaches the final `_ =>` arm of the per-schema decode match — normally impossible unless the two match arms diverge after an adapter update.","commonSituations":"Running a newer Databento dbn crate where new schema variants exist; a code change that added a schema to the validation allow-list but not to the decode dispatch; stale adapter version.","solutions":["Check the adapter version against the dbn crate version and upgrade the adapter so validation and dispatch match.","Report/fix the mismatch: add the schema to the decode match or remove it from the allow-list.","Use only long-standing schemas (mbp-1, tbbo, bbo-1s/1m, cmbp-1, tcbbo, cbbo-1s/1m) until the adapter is fixed."],"exampleFix":"// before\n_ => anyhow::bail!(\"Invalid schema {dbn_schema}\"),\n// after\n_ => anyhow::bail!(\"Schema {dbn_schema} passed validation but has no decode handler; this is an adapter bug\"),","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"let quotes = get_range_quotes(params).await.unwrap_or_else(|e| {\n    assert!(!e.to_string().contains(\"Invalid schema\"), \"adapter bug: {e}\");\n    Vec::new()\n});","preventionTips":["Use only well-established schemas (mbp-1, tbbo, bbo-1s/1m, cmbp-1, tcbbo, cbbo-1s/1m).","Keep adapter and dbn crate versions aligned; this arm indicates internal divergence.","Treat this error as a bug report trigger, not a user-input problem."],"tags":["databento","schema","internal-invariant","historical"],"backgroundTag":"internal-invariant-violation","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"}