cube-js/cube · error

cubeStoreDriverFactory is a required option for Cube Store c

Error message

cubeStoreDriverFactory is a required option for Cube Store cache driver

What it means

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.

Source

Thrown at packages/cubejs-query-orchestrator/src/orchestrator/QueryCache.ts:219

  protected memoryCache: LRUCache<string, CacheEntry>;

  protected static readonly IN_MEMORY_CACHE_DISABLE_PERIOD = 5 * 60 * 1000;

  protected readonly localRefreshKeyEnabled: boolean;

  public constructor(
    protected readonly cachePrefix: string,
    protected readonly driverFactory: DriverFactoryByDataSource,
    protected readonly logger: LoggerFn,
    public readonly options: QueryCacheOptions
  ) {
    switch (options.cacheAndQueueDriver || 'memory') {
      case 'memory':
        this.cacheDriver = new LocalCacheDriver();
        break;
      case 'cubestore':
        if (!options.cubeStoreDriverFactory) {
          throw new Error('cubeStoreDriverFactory is a required option for Cube Store cache driver');
        }

        this.cacheDriver = new CubeStoreCacheDriver(
          options.cubeStoreDriverFactory
        );
        break;
      default:
        throw new Error(`Unknown cache driver: ${options.cacheAndQueueDriver}`);
    }

    this.memoryCache = new LRUCache<string, CacheEntry>({
      max: options.maxInMemoryCacheEntries || 10000
    });
    this.localRefreshKeyEnabled = options.localRefreshKey ?? false;
  }

  /**
   * Whether interval based refresh keys are answered from this instance clock instead of being

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Provide options.cubeStoreDriverFactory when cacheAndQueueDriver is set to 'cubestore' (QueryOrchestrator normally wires this from CUBEJS_CUBESTORE_HOST/PORT)
  2. Set CUBEJS_CUBESTORE_HOST and CUBEJS_CUBESTORE_PORT so the orchestrator can construct the Cube Store driver factory
  3. Fall back to the default 'memory' cache driver if Cube Store is not actually in use
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/cubejs-query-orchestrator/src/orchestrator/QueryCache.ts:219 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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