nautechsystems/nautilus_trader · error

No live aggregator for continuous future subscription {}

Error message

No live aggregator for continuous future subscription {}

What it means

The data engine's continuous-future segment request handler looks up a live bar aggregator keyed by the request's primary bar type; the requested bar type has no registered aggregator. This is an ordering/invariant error: the caller is asking to continue building a continuous futures series for a bar type that was never subscribed or has since been unsubscribed.

Source

Thrown at crates/data/src/engine/mod.rs:5421

            ts_init,
            true,
        );

        if let Some(child) = sub_child {
            self.execute(child);
        }

        self.schedule_continuous_future_transition(target_key);
    }

    fn apply_continuous_future_subscription_adjustment(
        &self,
        request: &ContinuousFutureRequest,
        segment_index: usize,
    ) -> anyhow::Result<()> {
        let key = bar_aggregator_key(request.primary_bar_type, None);
        let aggregator = self.bar_aggregators.get(&key).ok_or_else(|| {
            anyhow::anyhow!(
                "No live aggregator for continuous future subscription {}",
                request.primary_bar_type
            )
        })?;
        let adjustment = request.adjustment_for_segment(segment_index);
        aggregator
            .borrow_mut()
            .set_adjustment(adjustment, request.adjustment_mode);
        Ok(())
    }

    fn apply_continuous_future_subscription_adjustment_for(
        &self,
        target_bar_type: BarType,
        segment_index: usize,
    ) -> anyhow::Result<()> {
        let Some(state) = self
            .continuous_future_subscriptions

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Subscribe to the primary bar type first so the engine creates a live bar aggregator before issuing continuous-future segment requests.
  2. Verify request.primary_bar_type exactly matches the subscribed BarType (instrument id, aggregation, step, price type).
  3. Check that nothing unsubscribed or cleared bar aggregators between subscription and the request.
  4. If this is intended to be optional, handle the missing-aggregator case upstream instead of letting the anyhow error propagate.

Example fix

// before
let aggregator = self.bar_aggregators.get(&key).ok_or_else(|| {
    anyhow::anyhow!("No live aggregator for continuous future subscription {}", request.primary_bar_type)
})?;
// after
let aggregator = match self.bar_aggregators.get(&key) {
    Some(a) => a,
    None => {
        log::warn!("no live aggregator for {}; skipping segment", request.primary_bar_type);
        return Ok(());
    }
};
Defensive patterns

Strategy: validation

Validate before calling

// before issuing the continuous-future request, check the aggregator exists
let key = bar_aggregator_key(request.primary_bar_type, None);
if !engine.bar_aggregators.contains_key(&key) {
    // subscribe to request.primary_bar_type first or skip the request
}

Prevention

When it happens

Trigger: Calling the continuous-future segment handling path (with a ContinuousFutureRequest and segment_index) when self.bar_aggregators contains no entry for key(primary_bar_type) — i.e. no live aggregator was created for that bar type beforehand.

Common situations: Requesting continuous-future bars without a prior subscription for the primary bar type; aggregator deregistered by an unsubscribe between the initial subscribe and the segment request; a typo/mismatch in the BarType (step, aggregation, price type) so the lookup key differs from the registered one.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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