cube-js/cube · error

It`s not possible to use Cube Store as queue/cache driver wi

Error message

It`s not possible to use Cube Store as queue/cache driver without using it as external

What it means

A consistency guard in QueryOrchestrator's constructor: when cacheAndQueueDriver is 'cubestore' but the externalDriverFactory does not return a CubeStoreDriver instance, Cube Store cannot serve as both the external store and the queue/cache driver, which the architecture requires. It fires during cubeStoreDriverFactory setup. The input at fault is an external driver factory producing a driver of a different class while the cubestore queue/cache driver is selected.

Source

Thrown at packages/cubejs-query-orchestrator/src/orchestrator/QueryOrchestrator.ts:97

    if (!['memory', 'cubestore'].includes(cacheAndQueueDriver)) {
      throw new Error(
        `Only 'cubestore' or 'memory' are supported for cacheAndQueueDriver option, passed: ${cacheAndQueueDriver}`
      );
    }

    const { externalDriverFactory, continueWaitTimeout, skipExternalCacheAndQueue } = options;

    this.cacheAndQueueDriver = cacheAndQueueDriver;

    const cubeStoreDriverFactory = cacheAndQueueDriver === 'cubestore' ? async () => {
      if (externalDriverFactory) {
        const externalDriver = await externalDriverFactory();
        if (externalDriver instanceof CubeStoreDriver) {
          return externalDriver;
        }

        throw new Error('It`s not possible to use Cube Store as queue/cache driver without using it as external');
      }

      throw new Error('Cube Store was specified as queue/cache driver. Please set CUBEJS_CUBESTORE_HOST and CUBEJS_CUBESTORE_PORT variables. Please see https://cube.dev/docs/deployment/production-checklist#set-up-cube-store to learn more.');
    } : undefined;

    this.queryCache = new QueryCache(
      this.redisPrefix,
      driverFactory,
      this.logger,
      {
        externalDriverFactory,
        cacheAndQueueDriver,
        cubeStoreDriverFactory,
        continueWaitTimeout,
        skipExternalCacheAndQueue,
        ...options.queryCacheOptions,
      }
    );

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Configure CUBEJS_CUBESTORE_HOST and CUBEJS_CUBESTORE_PORT so externalDriverFactory returns a CubeStoreDriver and Cube Store can also serve as queue/cache
  2. Change cacheAndQueueDriver to 'memory' when using a non-Cube Store external database
  3. Ensure the external driver factory actually returns a CubeStoreDriver instance before selecting 'cubestore' as the queue/cache driver
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/cubejs-query-orchestrator/src/orchestrator/QueryOrchestrator.ts:97 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/3f138f1c12e76db4. Report an issue: GitHub.