{"record":{"id":"391c29e60561a41e","repo":"cube-js/cube","slug":"scheduled-refresh-is-unsupported-for-preaggregat","errorCode":null,"errorMessage":"Scheduled refresh is unsupported for ${preAggregation.preAggregation.type} of ${preAggregation.preAggregationName}","messagePattern":"Scheduled refresh is unsupported for (.+?) of (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-server-core/src/core/RefreshScheduler.ts","lineNumber":223,"sourceCode":"      const dimensionsCount = Object.keys(cubeFromPath.dimensions || {}).length;\n      if (measuresCount === 0 && dimensionsCount === 0) {\n        throw new Error(\n          `Can't refresh pre-aggregation without measures and dimensions: ${preAggregation.preAggregationName}`\n        );\n      }\n      return {\n        ...queryingOptions,\n        ...(\n          measuresCount &&\n            { measures: [`${preAggregation.cube}.${Object.keys(cubeFromPath.measures)[0]}`] }\n        ),\n        ...(\n          dimensionsCount &&\n            { dimensions: [`${preAggregation.cube}.${Object.keys(cubeFromPath.dimensions)[0]}`] }\n        )\n      };\n    } else {\n      throw new Error(\n        `Scheduled refresh is unsupported for ${preAggregation.preAggregation.type} of ${preAggregation.preAggregationName}`\n      );\n    }\n  }\n\n  /**\n   * Evaluate and returns minimal QueryQueue concurrency value.\n   */\n  protected async getSchedulerConcurrency(\n    core: CubejsServerCore,\n    context: RequestContext,\n  ): Promise<null | number> {\n    const orchestratorApi = await core\n      .getOrchestratorApi(context);\n    const preaggsQueues = orchestratorApi.getQueryOrchestrator()\n      .getPreAggregations()\n      .getQueues();\n","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-server-core/src/core/RefreshScheduler.ts#L205-L241","documentation":"baseQueryForPreAggregation only knows how to build refresh queries for 'originalSql' (and reference-bearing) pre-aggregations. For any other pre-aggregation type it cannot construct a base refresh query, so scheduled refresh throws this error naming the unsupported type and pre-aggregation.","triggerScenarios":"The scheduled refresh scheduler walks pre-aggregations and hits one whose preAggregation.type is not handled by baseQueryForPreAggregation (not originalSql and without usable references), triggering the else-branch throw.","commonSituations":"Using custom/experimental pre-aggregation types (e.g. rollupLambda, custom member types) with scheduledRefresh enabled; a plugin or compiler extension introduces a new pre-aggregation type the scheduler doesn't recognize; typo in the type field of the pre-aggregation definition.","solutions":["Set the pre-aggregation type to a scheduler-supported one ('originalSql' or standard 'rollup')","Provide explicit measures/dimensions/timeDimensions references so the pre-aggregation resolves to a supported form","Exclude this pre-aggregation from scheduled refresh (adjust scheduledRefresh config / refreshStrategy) and refresh it on-demand instead","Verify the type string for typos in the data model"],"exampleFix":"// before\npreAggregations: {\n  main: { type: 'rollupLambda' }\n}\n// after\npreAggregations: {\n  main: {\n    type: 'rollup',\n    measureReferences: [Events.count],\n    timeDimensionReference: Events.createdAt,\n    granularity: 'day'\n  }\n}","handlingStrategy":"validation","validationCode":"const SCHEDULABLE_TYPES = ['originalSql', 'rollup'];\nfunction assertSchedulable(pa) {\n  if (!SCHEDULABLE_TYPES.includes(pa.type)) {\n    throw new Error(`Exclude ${pa.preAggregationName} (${pa.type}) from scheduled refresh`);\n  }\n}","typeGuard":"const isSchedulablePreAgg = (pa: any): pa is { type: 'originalSql' | 'rollup' } =>\n  pa?.type === 'originalSql' || pa?.type === 'rollup';","tryCatchPattern":"try {\n  await scheduler.baseQuery(preAggregation);\n} catch (e) {\n  if (e.message.startsWith('Scheduled refresh is unsupported for')) {\n    logger.warn(`Skipping scheduled refresh: ${e.message}`);\n  } else { throw e; }\n}","preventionTips":["Use only scheduler-supported pre-aggregation types when scheduledRefresh is on","Verify type strings for typos in the data model","Exclude custom/experimental pre-aggregation types from scheduled refresh config"],"tags":["pre-aggregations","scheduler","data-model"],"backgroundTag":"unsupported-preaggregation-type","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}