{"record":{"id":"ac698da7c47fec3b","repo":"cube-js/cube","slug":"streaming-queries-to-cube-store-aren-t-supported","errorCode":null,"errorMessage":"Streaming queries to Cube Store aren't supported","messagePattern":"Streaming queries to Cube Store aren't supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-query-orchestrator/src/orchestrator/QueryQueue.ts","lineNumber":236,"sourceCode":"        queryHandler,\n        query,\n        queryKey,\n        stageQueryKey: options.stageQueryKey,\n        priority,\n        requestId: options.requestId,\n        addedToQueueTime: new Date().getTime(),\n      };\n      this.logger('Waiting for query', {\n        queueId: options.queueId,\n        spanId: options.spanId,\n        queueSize: 0,\n        queryKey: queryDef.queryKey,\n        queuePrefix: this.redisQueuePrefix,\n        requestId: options.requestId,\n        waitingForRequestId: queryDef.requestId\n      });\n      if (queryHandler === 'stream') {\n        throw new Error('Streaming queries to Cube Store aren\\'t supported');\n      }\n      const result = await this.processQuerySkipQueue(queryDef, options.queueId);\n      return this.parseResult(result);\n    }\n\n    const queueConnection = await this.queueDriver.createConnection();\n    let waitingContext;\n    let streamWait: QueryStreamWait | null = null;\n\n    try {\n      if (!(priority >= -10000 && priority <= 10000)) {\n        throw new Error('Priority should be between -10000 and 10000');\n      }\n\n      // Result here won't be fetched for a forced build query and a jobbed build\n      // query (initialized by the /cubejs-system/v1/pre-aggregations/jobs\n      // endpoint).\n      let result = !query.forceBuild && await queueConnection.getResult(queryKey, options.externalId);","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-query-orchestrator/src/orchestrator/QueryQueue.ts#L218-L254","documentation":"QueryQueue.executeInQueue rejects any query whose queryHandler is 'stream', because this queue path processes queries over Redis and returns fully materialized results; it cannot hand back a QueryStream. The library intentionally fails fast instead of silently degrading a streaming request to a buffered one.","triggerScenarios":"Calling executeInQueue (directly or via the orchestrator) with a queryDef whose queryHandler property is the string 'stream'.","commonSituations":"Custom orchestrator code or a pre-aggregation/job flow that attempts to stream results from Cube Store through the standard query queue; copying code that uses cancelableQueryPromise/streaming elsewhere into the queue path.","solutions":["Remove the 'stream' queryHandler from the query definition and use the normal (buffered) handler","Use the dedicated streaming API (e.g. driver-level QueryStream / queryStream methods) instead of routing through executeInQueue","If streaming is genuinely required, bypass the queue and call the streaming path directly on the driver"],"exampleFix":"// before\nawait queue.executeInQueue('stream', queryKey, { ...query, queryHandler: 'stream' }, priority, options);\n// after\nawait queue.executeInQueue('query', queryKey, { ...query, queryHandler: 'query' }, priority, options);","handlingStrategy":"validation","validationCode":"if (queryDef.queryHandler === 'stream') { throw new Error('Use the driver-level streaming API, not executeInQueue'); }","typeGuard":"function isStreamingHandler(q) { return q.queryHandler === 'stream'; }","tryCatchPattern":"try { await queue.executeInQueue(handler, key, queryDef, priority, opts); } catch (e) { if (e.message.includes(\"Streaming queries to Cube Store aren't supported\")) { return streamDirectly(queryDef); } throw e; }","preventionTips":["Never set queryHandler to 'stream' for queue-executed queries","Use driver streaming methods for streaming workloads","Audit custom orchestration code for copied 'stream' handler values"],"tags":["streaming","query-queue","unsupported-operation"],"backgroundTag":"streaming-not-supported","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}