nautechsystems/nautilus_trader · error · anyhow::Error

No feed handler found for dataset: {dataset}

Error message

No feed handler found for dataset: {dataset}

What it means

Subscriptions are routed to a per-dataset feed handler via an internal command channel registry (`cmd_channels`). If no feed handler has been created for the dataset — typically because connect() has not run or the handler for that dataset was never established — `send_subscription_to_dataset` fails with this error.

Source

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

            return true;
        }

        false
    }

    fn send_subscription_to_dataset(
        &self,
        dataset: &str,
        price_precision: Option<(Symbol, u8)>,
        subscription: Subscription,
        start_after_subscribe: bool,
    ) -> anyhow::Result<()> {
        let tx = {
            let channels = self.cmd_channels.lock();
            channels
                .get(dataset)
                .cloned()
                .ok_or_else(|| anyhow::anyhow!("No feed handler found for dataset: {dataset}"))?
        };

        send_subscription_commands(
            &tx,
            dataset,
            price_precision,
            subscription,
            start_after_subscribe,
        )
    }

    fn send_close_to_active_feeds(&self) {
        let channels = self.cmd_channels.lock();
        for (dataset, tx) in channels.iter() {
            if let Err(e) = tx.send(HandlerCommand::Close) {
                log::warn!("Failed to send close command to dataset {dataset}: {e}");
            }
        }

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Ensure connect() has completed successfully before subscribing
  2. Check logs for feed handler startup failures for that dataset and fix the root cause
  3. Reconnect to recreate feed handlers, then retry the subscription
  4. Verify the instrument resolves to the expected dataset and that this dataset was initialized

Example fix

// before
client.connect().await; // not awaited
client.subscribe_quotes(instrument_id).await?;
// after
client.connect().await?;
client.subscribe_quotes(instrument_id).await?;
Defensive patterns

Strategy: validation

Validate before calling

if !client.is_connected() {
    anyhow::bail!("call connect() before subscribing");
}

Try / catch

if let Err(e) = client.subscribe_quotes(instrument_id).await {
    if e.to_string().contains("No feed handler found for dataset") {
        client.disconnect().await.ok();
        client.connect().await?;
        client.subscribe_quotes(instrument_id).await?;
    }
}

Prevention

When it happens

Trigger: Calling any of the subscribe_* methods for an instrument whose dataset has no entry in `cmd_channels` — i.e. subscribing before connect() or for a dataset whose feed handler failed to start.

Common situations: Subscribing before calling connect(), a feed handler startup failure that was silently ignored, subscriptions racing the async connect path, or mixing datasets where only some handlers were created.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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