{"record":{"id":"b3ee75146c70f69e","repo":"nautechsystems/nautilus_trader","slug":"rtype-is-not-a-supported-bar-aggregation-was-m","errorCode":null,"errorMessage":"`rtype` is not a supported bar aggregation, was {msg.hd.rtype}","messagePattern":"`rtype` is not a supported bar aggregation, was (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/databento/src/decode/market_data.rs","lineNumber":669,"sourceCode":"            BarType::new(instrument_id, BAR_SPEC_1S, AggregationSource::External)\n        }\n        33 => {\n            // ohlcv-1m\n            BarType::new(instrument_id, BAR_SPEC_1M, AggregationSource::External)\n        }\n        34 => {\n            // ohlcv-1h\n            BarType::new(instrument_id, BAR_SPEC_1H, AggregationSource::External)\n        }\n        35 => {\n            // ohlcv-1d\n            BarType::new(instrument_id, BAR_SPEC_1D, AggregationSource::External)\n        }\n        36 => {\n            // ohlcv-eod\n            BarType::new(instrument_id, BAR_SPEC_1D, AggregationSource::External)\n        }\n        _ => anyhow::bail!(\n            \"`rtype` is not a supported bar aggregation, was {}\",\n            msg.hd.rtype\n        ),\n    };\n\n    Ok(bar_type)\n}\n\n/// # Errors\n///\n/// Returns an error if `rtype` is not a supported bar aggregation.\npub fn decode_ts_event_adjustment(msg: &dbn::OhlcvMsg) -> anyhow::Result<DurationNanos> {\n    let adjustment = match msg.hd.rtype {\n        32 => {\n            // ohlcv-1s\n            BAR_CLOSE_ADJUSTMENT_1S\n        }\n        33 => {","sourceCodeStart":651,"sourceCodeEnd":687,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/databento/src/decode/market_data.rs#L651-L687","documentation":"`decode_bar_type` maps the Databento record's `rtype` header to a Nautilus `BarType`. If the `rtype` does not correspond to a supported OHLCV bar aggregation (e.g. a seconds/minutes/hours/eod mapping the decoder knows), it bails with this message because it cannot represent the record as a bar.","triggerScenarios":"Subscribing or requesting bars and receiving a record whose `hd.rtype` is outside the supported bar set (supported: known OHLCV rtypes like 32/33/34/35/36 for 1s/1m/1h/1d/eod variants); decoding a non-bar record through the bar path.","commonSituations":"Requesting an unconventional bar interval from Databento (e.g. 5-minute bars via a custom rtype) that the decoder has no mapping for; Databento adding new rtypes the adapter version predates.","solutions":["Request only supported bar aggregations (1-second, 1-minute, 1-hour, 1-day, eod)","Upgrade the adapter crate to get mappings for newer rtypes","Aggregate higher-level bars locally from a supported base interval instead","Log the rtype value and check the dbn crate's rtype documentation"],"exampleFix":"// before\nrequest_bars(bar_spec=MIN_5) // yields unsupported rtype\n// after\nrequest_bars(bar_spec=MIN_1) // supported, aggregate 5m locally","handlingStrategy":"validation","validationCode":"const SUPPORTED_BAR_RTYPES: &[u16] = &[32, 33, 34, 35, 36]; // match adapter mapping\nfn is_supported_bar_rtype(rtype: u16) -> bool { SUPPORTED_BAR_RTYPES.contains(&rtype) }","typeGuard":null,"tryCatchPattern":"match decode_record(record) {\n    Ok(data) => data,\n    Err(e) if e.to_string().contains(\"not a supported bar aggregation\") => { /* skip record or resubscribe with supported interval */ }\n    Err(e) => return Err(e),\n}","preventionTips":["Request only 1s/1m/1h/1d/eod bar aggregations","Check rtype support before subscribing to a bar schema","Keep the adapter crate current for new Databento rtypes","Aggregate exotic intervals locally from supported base bars"],"tags":["rust","databento","bars","rtype"],"backgroundTag":"unsupported-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"}