nautechsystems/nautilus_trader · error · anyhow::Error

No dataset found for venue: {venue}

Error message

No dataset found for venue: {venue}

What it means

The Databento data client maps each trading venue to a Databento dataset via its configured loader. If the venue has no mapping entry, `get_dataset_for_venue` fails with this error before any subscription is attempted. The mapping typically comes from configuration or a defaults file.

Source

Thrown at crates/adapters/databento/src/data.rs:260

        self.config.api_key()
    }

    /// Returns a masked version of the API key for logging purposes.
    #[must_use]
    pub fn api_key_masked(&self) -> String {
        self.config.api_key_masked()
    }

    /// Gets the dataset for a given venue using the data loader.
    ///
    /// # Errors
    ///
    /// Returns an error if the venue-to-dataset mapping cannot be found.
    fn get_dataset_for_venue(&self, venue: Venue) -> anyhow::Result<String> {
        self.loader
            .get_dataset_for_venue(&venue)
            .map(ToString::to_string)
            .ok_or_else(|| anyhow::anyhow!("No dataset found for venue: {venue}"))
    }

    /// Gets or creates a feed handler for the specified dataset.
    fn get_or_create_feed_handler(&self, dataset: &str) -> bool {
        let mut channels = self.cmd_channels.lock();

        if !channels.contains_key(dataset) {
            log::debug!("Creating new feed handler for dataset: {dataset}");
            let cmd_tx = self.initialize_live_feed(dataset.to_string());
            channels.insert(dataset.to_string(), cmd_tx);

            log::debug!("Feed handler created for dataset: {dataset}, channel stored");
            return true;
        }

        false
    }

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Add the venue-to-dataset mapping for the venue in the client's config/loader
  2. Check venue name spelling and exact casing against the mapping
  3. Verify the mapping file/defaults are actually loaded (path correct, parsed successfully)
  4. Query the client with a known-mapped venue to confirm the loader is populated

Example fix

// before
let client = DatabentoDataClient::new(config, cache, clock); // no mappings
// after
let mut config = config;
config.dataset_venue_map = VenueDatasetMap::from_config("databento_venues.json")?;
let client = DatabentoDataClient::new(config, cache, clock);
Defensive patterns

Strategy: validation

Validate before calling

fn ensure_dataset_mapped(map: &VenueDatasetMap, venue: Venue) -> Result<(), String> {
    map.get_dataset_for_venue(&venue)
        .ok_or_else(|| format!("no Databento dataset configured for venue {venue}"))
}

Try / catch

match get_dataset_for_venue(venue) {
    Ok(dataset) => subscribe(dataset),
    Err(e) if e.to_string().starts_with("No dataset found for venue") => {
        eprintln!("add a venue->dataset mapping for {venue}");
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling subscribe_instrument, subscribe_quotes, subscribe_trades, subscribe_book_deltas, subscribe_instrument_status, or request_instruments with a Venue whose name has no entry in the venue-to-dataset mapping.

Common situations: Typos or casing mismatches in venue names (e.g. 'BINANCE' vs 'BINANCE.ROUTE'), using a venue not present in the defaults config, or failing to supply the venue-to-dataset mapping file/option at client construction.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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