{"record":{"id":"3f138f1c12e76db4","repo":"cube-js/cube","slug":"it-s-not-possible-to-use-cube-store-as-queue-cache","errorCode":null,"errorMessage":"It`s not possible to use Cube Store as queue/cache driver without using it as external","messagePattern":"It`s not possible to use Cube Store as queue/cache driver without using it as external","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-query-orchestrator/src/orchestrator/QueryOrchestrator.ts","lineNumber":97,"sourceCode":"\n    if (!['memory', 'cubestore'].includes(cacheAndQueueDriver)) {\n      throw new Error(\n        `Only 'cubestore' or 'memory' are supported for cacheAndQueueDriver option, passed: ${cacheAndQueueDriver}`\n      );\n    }\n\n    const { externalDriverFactory, continueWaitTimeout, skipExternalCacheAndQueue } = options;\n\n    this.cacheAndQueueDriver = cacheAndQueueDriver;\n\n    const cubeStoreDriverFactory = cacheAndQueueDriver === 'cubestore' ? async () => {\n      if (externalDriverFactory) {\n        const externalDriver = await externalDriverFactory();\n        if (externalDriver instanceof CubeStoreDriver) {\n          return externalDriver;\n        }\n\n        throw new Error('It`s not possible to use Cube Store as queue/cache driver without using it as external');\n      }\n\n      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.');\n    } : undefined;\n\n    this.queryCache = new QueryCache(\n      this.redisPrefix,\n      driverFactory,\n      this.logger,\n      {\n        externalDriverFactory,\n        cacheAndQueueDriver,\n        cubeStoreDriverFactory,\n        continueWaitTimeout,\n        skipExternalCacheAndQueue,\n        ...options.queryCacheOptions,\n      }\n    );","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-query-orchestrator/src/orchestrator/QueryOrchestrator.ts#L79-L115","documentation":"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.","triggerScenarios":"Thrown at packages/cubejs-query-orchestrator/src/orchestrator/QueryOrchestrator.ts:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure CUBEJS_CUBESTORE_HOST and CUBEJS_CUBESTORE_PORT so externalDriverFactory returns a CubeStoreDriver and Cube Store can also serve as queue/cache","Change cacheAndQueueDriver to 'memory' when using a non-Cube Store external database","Ensure the external driver factory actually returns a CubeStoreDriver instance before selecting 'cubestore' as the queue/cache driver"],"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"}