{"record":{"id":"073176d9bd2763be","repo":"cube-js/cube","slug":"cubestoredriverfactory-is-a-required-option-for-cu","errorCode":null,"errorMessage":"cubeStoreDriverFactory is a required option for Cube Store cache driver","messagePattern":"cubeStoreDriverFactory is a required option for Cube Store cache driver","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-query-orchestrator/src/orchestrator/QueryCache.ts","lineNumber":219,"sourceCode":"  protected memoryCache: LRUCache<string, CacheEntry>;\n\n  protected static readonly IN_MEMORY_CACHE_DISABLE_PERIOD = 5 * 60 * 1000;\n\n  protected readonly localRefreshKeyEnabled: boolean;\n\n  public constructor(\n    protected readonly cachePrefix: string,\n    protected readonly driverFactory: DriverFactoryByDataSource,\n    protected readonly logger: LoggerFn,\n    public readonly options: QueryCacheOptions\n  ) {\n    switch (options.cacheAndQueueDriver || 'memory') {\n      case 'memory':\n        this.cacheDriver = new LocalCacheDriver();\n        break;\n      case 'cubestore':\n        if (!options.cubeStoreDriverFactory) {\n          throw new Error('cubeStoreDriverFactory is a required option for Cube Store cache driver');\n        }\n\n        this.cacheDriver = new CubeStoreCacheDriver(\n          options.cubeStoreDriverFactory\n        );\n        break;\n      default:\n        throw new Error(`Unknown cache driver: ${options.cacheAndQueueDriver}`);\n    }\n\n    this.memoryCache = new LRUCache<string, CacheEntry>({\n      max: options.maxInMemoryCacheEntries || 10000\n    });\n    this.localRefreshKeyEnabled = options.localRefreshKey ?? false;\n  }\n\n  /**\n   * Whether interval based refresh keys are answered from this instance clock instead of being","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-query-orchestrator/src/orchestrator/QueryCache.ts#L201-L237","documentation":"A startup validation guard in QueryCache's constructor: when options.cacheAndQueueDriver is 'cubestore', the cache driver needs a factory that produces a CubeStoreDriver connection; the option was omitted or null. This fails fast at orchestration initialization instead of failing lazily on first cache access. The input at fault is QueryCacheOptions without cubeStoreDriverFactory while requesting the Cube Store cache driver.","triggerScenarios":"Thrown at packages/cubejs-query-orchestrator/src/orchestrator/QueryCache.ts:219 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide options.cubeStoreDriverFactory when cacheAndQueueDriver is set to 'cubestore' (QueryOrchestrator normally wires this from CUBEJS_CUBESTORE_HOST/PORT)","Set CUBEJS_CUBESTORE_HOST and CUBEJS_CUBESTORE_PORT so the orchestrator can construct the Cube Store driver factory","Fall back to the default 'memory' cache driver if Cube Store is not actually in use"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}