nautechsystems/nautilus_trader · error
Invalid schema. Must be one of: mbp-1, tbbo, bbo-1s, bbo-1m,
Error message
Invalid schema. Must be one of: mbp-1, tbbo, bbo-1s, bbo-1m, cmbp-1, tcbbo, cbbo-1s, cbbo-1m
What it means
`get_range_quotes` only supports quote-producing Databento schemas: mbp-1, tbbo, bbo-1s, bbo-1m, cmbp-1, tcbbo, cbbo-1s, cbbo-1m. Any other schema value passed in the request params causes this bail before the data request is made. It is an early input-validation guard against schemas whose records cannot be converted into `QuoteTick`.
Source
Thrown at crates/adapters/databento/src/historical.rs:373
.symbols
.first()
.ok_or_else(|| anyhow::anyhow!("No symbols provided"))?;
let stype_in = infer_symbology_type(first_symbol);
let end = params.end.unwrap_or_else(|| self.clock.get_time_ns());
let time_range = get_date_time_range(params.start, end)?;
let schema = schema.unwrap_or_else(|| "mbp-1".to_string());
let dbn_schema = dbn::Schema::from_str(&schema)?;
match dbn_schema {
dbn::Schema::Mbp1
| dbn::Schema::Tbbo
| dbn::Schema::Bbo1S
| dbn::Schema::Bbo1M
| dbn::Schema::Cmbp1
| dbn::Schema::Tcbbo
| dbn::Schema::Cbbo1S
| dbn::Schema::Cbbo1M => (),
_ => anyhow::bail!(
"Invalid schema. Must be one of: mbp-1, tbbo, bbo-1s, bbo-1m, cmbp-1, tcbbo, cbbo-1s, cbbo-1m"
),
}
let range_params = GetRangeParams::builder()
.dataset(params.dataset)
.date_time_range(time_range)
.symbols(symbols)
.stype_in(stype_in)
.schema(dbn_schema)
.maybe_limit(params.limit.and_then(NonZeroU64::new))
.build();
let price_precision_arg = params.price_precision;
let mut client = (*self.inner).clone();
let mut decoder = client
.timeseries()View on GitHub (pinned to 18893faf8b)
Solutions
- Set `schema` to one of the supported quote schemas (mbp-1, tbbo, bbo-1s, bbo-1m, cmbp-1, tcbbo, cbbo-1s, cbbo-1m).
- If you need trades, call `get_range_trades` instead; for depth use `get_range_order_book_depth10`.
- Validate/normalize the schema value in your config before constructing the request.
- If a newly-released Databento schema is needed, update the adapter's match arm to support it.
Example fix
// before let params = params.schema(dbn::Schema::Trades); historical.get_range_quotes(params).await?; // after let params = params.schema(dbn::Schema::Mbp1); historical.get_range_quotes(params).await?;
Defensive patterns
Strategy: validation
Validate before calling
const QUOTE_SCHEMAS: &[dbn::Schema] = &[
dbn::Schema::Mbp1, dbn::Schema::Tbbo, dbn::Schema::Bbo1S,
dbn::Schema::Bbo1M, dbn::Schema::Cmbp1, dbn::Schema::Tcbbo,
dbn::Schema::Cbbo1S, dbn::Schema::Cbbo1M,
];
assert!(QUOTE_SCHEMAS.contains(&schema), "unsupported quote schema"); Type guard
fn is_quote_schema(s: dbn::Schema) -> bool {
matches!(s, dbn::Schema::Mbp1 | dbn::Schema::Tbbo | dbn::Schema::Bbo1S
| dbn::Schema::Bbo1M | dbn::Schema::Cmbp1 | dbn::Schema::Tcbbo
| dbn::Schema::Cbbo1S | dbn::Schema::Cbbo1M)
} Prevention
- Map request intent (quotes vs trades vs depth) to the schema, not config strings.
- Validate configured schema values at startup.
- Use get_range_quotes only with quote-producing schemas.
When it happens
Trigger: Calling `get_range_quotes` (historical quotes fetch) with `params.schema` set to e.g. `trades`, `ohlcv-1m`, `mbp-10`, or any schema outside the allow-list.
Common situations: Copy-pasting a schema string/enum from a trades or depth request into a quotes request; building the schema dynamically from config where the wrong value was configured; Databento adding a new schema not yet allow-listed.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Invalid schema. Must be one of: trades, tbbo, tcbbo, mbp-1,
- Invalid schema {dbn_schema}
- Colors dict missing required keys: {missing_keys}. Required
- Invalid `{SCHEMA_PARAM}` '{schema}'. Must be one of: {allowe
- Invalid negative `contract_multiplier`: {value}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/9a07701d3f1192f3.
Report an issue: GitHub.