cube-js/cube · error

Unknown cache driver: ${options.cacheAndQueueDriver}

Error message

Unknown cache driver: ${options.cacheAndQueueDriver}

What it means

The default branch of the same switch in QueryCache's constructor: the configured cacheAndQueueDriver value is not one of the supported drivers ('memory' or 'cubestore'). This is a fail-fast config validation for misspelled or unsupported cache driver names in QueryCacheOptions (often from CUBEJS_CACHE_AND_QUEUE_DRIVER or orchestrator options). The input at fault is an unrecognized options.cacheAndQueueDriver string.

Source

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

    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
   * run as queries and cached.
   */
  public isLocalRefreshKeyActive(): boolean {
    return this.localRefreshKeyEnabled && !this.options.refreshKeyRenewalThreshold;
  }

  public localRefreshKeyResult(queryOptions?: QueryOptions): [{ refresh_key: string }] | null {
    if (!this.localRefreshKeyEnabled || !isValidLocalRefreshKey(queryOptions?.localRefreshKey)) {

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Set cacheAndQueueDriver (CUBEJS_CACHE_AND_QUEUE_DRIVER) to one of the supported values: 'memory' or 'cubestore'
  2. Remove the typo/legacy value from the environment or orchestrator options
  3. If a custom cache driver is needed, extend the switch in QueryCache's constructor rather than passing an unknown identifier
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/cubejs-query-orchestrator/src/orchestrator/QueryCache.ts:227 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/57ac54523534e19c. Report an issue: GitHub.