{"record":{"id":"5dffe5e5295e255f","repo":"cube-js/cube","slug":"createoptions-orchestratoroptions-rolluponlymode-c","errorCode":null,"errorMessage":"CreateOptions.orchestratorOptions.rollupOnlyMode cannot be trusly for API instance if CUBEJS_PRE_AGGREGATIONS_BUILDER is set to true","messagePattern":"CreateOptions\\.orchestratorOptions\\.rollupOnlyMode cannot be trusly for API instance if CUBEJS_PRE_AGGREGATIONS_BUILDER is set to true","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cubejs-server-core/src/core/OptsHandler.ts","lineNumber":140,"sourceCode":"        `DriverConfig or driver instance: <${\n          typeof val\n        }>${\n          JSON.stringify(val, undefined, 2)\n        }`\n      );\n    }\n  }\n\n  /**\n   * Assert orchestration options.\n   */\n  private asserOrchestratorOptions(opts: OrchestratorOptions) {\n    if (\n      opts.rollupOnlyMode &&\n      this.isApiWorker() &&\n      getEnv('preAggregationsBuilder')\n    ) {\n      throw new Error(\n        'CreateOptions.orchestratorOptions.rollupOnlyMode cannot be trusly ' +\n        'for API instance if CUBEJS_PRE_AGGREGATIONS_BUILDER is set to true'\n      );\n    }\n  }\n\n  /**\n   * Default database factory function.\n   */\n  private defaultDriverFactory(ctx: DriverContext): DriverConfig {\n    const type = <DatabaseType>getEnv('dbType', {\n      dataSource: assertDataSource(ctx.dataSource),\n      preAggregations: ctx.preAggregations,\n    });\n\n    return { type };\n  }\n","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-server-core/src/core/OptsHandler.ts#L122-L158","documentation":"asserOrchestratorOptions rejects an invalid combination of scheduling flags: on an API instance (isApiWorker) when CUBEJS_PRE_AGGREGATIONS_BUILDER=true, orchestratorOptions.rollupOnlyMode must not be truthy. rollupOnlyMode makes the orchestrator only serve pre-built rollups, which conflicts with this instance also acting as the pre-aggregations builder. The error message contains a typo ('trusly' for 'truthy').","triggerScenarios":"Starting the server with CUBEJS_PRE_AGGREGATIONS_BUILDER=true in the environment while passing createOptions.orchestratorOptions.rollupOnlyMode: true for the API worker role.","commonSituations":"Copy-pasting rollupOnlyMode configs meant for store/orchestrator workers into the API instance; enabling pre-aggregations builder globally in docker-compose while all services share the same createOptions; multi-instance deployments misassigning roles.","solutions":["Remove rollupOnlyMode from the API instance's orchestratorOptions","Or unset CUBEJS_PRE_AGGREGATIONS_BUILDER if this instance shouldn't build pre-aggregations","Separate createOptions per role: keep rollupOnlyMode only on store/worker instances that are not the builder","Review the deployment topology so builder and rollup-only roles don't overlap"],"exampleFix":"// before\ncreate({ orchestratorOptions: { rollupOnlyMode: true } }) // with CUBEJS_PRE_AGGREGATIONS_BUILDER=true\n// after\ncreate({ orchestratorOptions: { rollupOnlyMode: false } }) // builder role, or remove the env var on rollup-only workers","handlingStrategy":"validation","validationCode":"function assertRollupConfigValid(orchestratorOptions = {}) {\n  const builder = process.env.CUBEJS_PRE_AGGREGATIONS_BUILDER === 'true';\n  if (builder && orchestratorOptions.rollupOnlyMode) {\n    throw new Error('rollupOnlyMode cannot be truthy on the API instance while CUBEJS_PRE_AGGREGATIONS_BUILDER=true');\n  }\n}\nassertRollupConfigValid(createOptions.orchestratorOptions);","typeGuard":"function hasValidRollupRoles(opts) {\n  const builder = process.env.CUBEJS_PRE_AGGREGATIONS_BUILDER === 'true';\n  return !(builder && opts && opts.orchestratorOptions && opts.orchestratorOptions.rollupOnlyMode);\n}","tryCatchPattern":"try {\n  await create(opts);\n} catch (e) {\n  if (e.message.includes('rollupOnlyMode cannot be')) {\n    console.error('Role conflict: either disable rollupOnlyMode here or unset CUBEJS_PRE_AGGREGATIONS_BUILDER.');\n  }\n  throw e;\n}","preventionTips":["Keep builder (CUBEJS_PRE_AGGREGATIONS_BUILDER) and rollupOnlyMode roles on separate instances","Templated docker-compose: verify per-service env vars don't leak shared createOptions","Document which instances set rollupOnlyMode in your deployment topology","Add a config check at container startup before server core initialization"],"tags":["config","orchestrator","pre-aggregations","env-var","conflict"],"backgroundTag":"conflicting-config-options","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}