nautechsystems/nautilus_trader · error · anyhow::Error

No symbols provided

Error message

No symbols provided

What it means

Guard in `get_range_instruments`: the request parameters contain an empty `symbols` list, so there is no first symbol from which to infer symbology type. The adapter refuses to issue a request that Databento would reject anyway.

Source

Thrown at crates/adapters/databento/src/historical.rs:282

        })
    }

    /// Fetches instrument definitions for the given parameters.
    ///
    /// # Errors
    ///
    /// Returns an error if the API request or data processing fails.
    pub async fn get_range_instruments(
        &self,
        params: RangeQueryParams,
    ) -> anyhow::Result<Vec<InstrumentAny>> {
        let symbols: Vec<&str> = params.symbols.iter().map(String::as_str).collect();
        check_consistent_symbology(&symbols)?;

        let first_symbol = params
            .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 range_params = GetRangeParams::builder()
            .dataset(params.dataset)
            .date_time_range(time_range)
            .symbols(symbols)
            .stype_in(stype_in)
            .schema(dbn::Schema::Definition)
            .maybe_limit(params.limit.and_then(NonZeroU64::new))
            .build();

        let mut client = (*self.inner).clone();
        let mut decoder = client
            .timeseries()
            .get_range(&range_params)
            .await

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Provide at least one symbol in params.symbols
  2. Guard the call site: return early if the symbol list is empty before constructing params
  3. Fix the upstream code that produced an empty filter list
  4. If 'all symbols' is intended, use the Databento wildcard symbol ('ALL_SYMBOLS') if supported for your request type

Example fix

// before
let params = GetRangeParamsBuilder::default().symbols(vec![]).build()?;
client.get_range_instruments(params).await?;
// after
let symbols = vec!["ESZ5".to_string()];
assert!(!symbols.is_empty());
let params = GetRangeParamsBuilder::default().symbols(symbols).build()?;
client.get_range_instruments(params).await?;
Defensive patterns

Strategy: validation

Validate before calling

if params.symbols.is_empty() {
    bail!("get_range_instruments requires at least one symbol");
}

Type guard

fn has_symbols(symbols: &[String]) -> bool { !symbols.is_empty() }

Prevention

When it happens

Trigger: Calling `get_range_instruments` with params whose `symbols: Vec<String>` is empty.

Common situations: Building params programmatically from a filtered/empty collection, or a config file where the symbols list was left blank.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/40c3c94da4ad2363. Report an issue: GitHub.