cube-js/cube · error · UserError

Auto rollups supported only in Enterprise version

Error message

Auto rollups supported only in Enterprise version

What it means

getCubeLattice() is the extension point for automatic rollup (automatically suggested pre-aggregations) and is only implemented in Cube Enterprise. The open-source build always throws this UserError when some feature requests a lattice for a cube.

Source

Thrown at packages/cubejs-schema-compiler/src/adapter/PreAggregations.ts:907

    );
  }

  private static flattenMembers(members: BaseMember[]): BaseMember[] {
    return R.flatten(
      members.map(m => m.getMembers()),
    );
  }

  private static flattenDimensionMembers(query: BaseQuery): BaseMember[] {
    return this.flattenMembers([
      ...query.dimensions,
      ...query.filters,
      ...query.segments,
    ]);
  }

  public getCubeLattice(_cube, _preAggregationName, _preAggregation): unknown {
    throw new UserError('Auto rollups supported only in Enterprise version');
  }

  /**
   * Returns pre-agg which determined as applicable for the query (the first one
   * from the list of potentially applicable pre-aggs). The order of the
   * potentially applicable pre-aggs is the same as the order in which these
   * pre-aggs appear in the schema file.
   */
  public findPreAggregationForQuery(): PreAggregationForQuery | undefined {
    if (!this.preAggregationForQuery) {
      if (this.query.useNativeSqlPlanner && this.query.canUseNativeSqlPlannerPreAggregation) {
        this.preAggregationForQuery = this.query.findPreAggregationForQueryRust();
      } else {
        this.preAggregationForQuery =
          this
            .rollupMatchResults()
            // Refresh worker can access specific pre-aggregations even in case those hidden by others
            .find(p => p.canUsePreAggregation && (!this.query.options.preAggregationId || p.preAggregationId === this.query.options.preAggregationId));

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Upgrade to Cube Enterprise (or Cube Cloud) if auto rollups are required.
  2. Define pre-aggregations manually in the data model instead of relying on auto rollups.
  3. Remove calls/configs that trigger lattice generation (e.g. autoRollups settings).
  4. Use community tooling (query logging + manual pre-agg definitions) as a substitute.

Example fix

// before
// relying on auto rollup suggestion
compilerApi: ..., // expecting suggestedRollups
// after
preAggregations: { main: { measures: [CUBE.count], dimensions: [CUBE.country] } } // manual definition
Defensive patterns

Strategy: validation

Validate before calling

const isEnterprise = process.env.CUBEJS_LICENSE_KEY;
if (featureRequiresAutoRollups && !isEnterprise) {
  throw new Error('Auto rollups require Cube Enterprise — define pre-aggregations manually instead');
}

Try / catch

try { await cubeApi.preAggregations(); } catch (e) { if (/Auto rollups supported only in Enterprise version/.test(e.message)) {
  // fall back to manual pre-aggregation definitions
  return manualPreAggregations; } throw e; }

Prevention

When it happens

Trigger: Using features that require auto rollups — e.g. rollup designer auto-suggestions, scheduling/rollup auto-refresh driven by query analysis, or API endpoints that ask for suggested rollups — on the community edition.

Common situations: Running OSS cubejs-server-core but enabling enterprise config flags; calling CubeApi.sql/lattices endpoints expecting auto-rollup suggestions; following Enterprise docs while on the OSS package.

Related errors


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/d8b5e255dbf3dc05. Report an issue: GitHub.