{"record":{"id":"4742847c0b5ded3a","repo":"cube-js/cube","slug":"empty-response-on-queue-command","errorCode":null,"errorMessage":"Empty response on QUEUE ${command}","messagePattern":"Empty response on QUEUE (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-cubestore-driver/src/CubeStoreQueueDriver.ts","lineNumber":164,"sourceCode":"    const fastTrack = await this.useFastTrack(priority);\n    if (fastTrack) {\n      values.push(this.options.concurrency);\n    }\n\n    const command = fastTrack ? 'ADD_AND_RETRIEVE' : 'ADD';\n    const rows = await this.driver.query<CubeStoreRetrieveResponse & { added: string }>(`QUEUE ${command}${modifiers}${fastTrack ? ' ?' : ''}`, values);\n    if (rows && rows.length) {\n      return [\n        rows[0].added === 'true' ? 1 : 0,\n        rows[0].id ? parseInt(rows[0].id, 10) : null,\n        parseInt(rows[0].pending, 10),\n        addedToQueueTime,\n        // An item which already existed is never added twice, but it still can be retrieved\n        fastTrack ? this.decodeRetrievedFromRow(rows[0], 'addToQueue') : null,\n      ];\n    }\n\n    throw new Error(`Empty response on QUEUE ${command}`);\n  }\n\n  public async getQueryAndRemove(hash: QueryKeyHash, queueId: QueueId | null): Promise<[QueryDef]> {\n    return [await this.cancelQuery(hash, queueId)];\n  }\n\n  public async cancelQuery(hash: QueryKeyHash, queueId: QueueId | null): Promise<QueryDef | null> {\n    const rows = await this.driver.query('QUEUE CANCEL ?', [\n      // queryKeyHash as compatibility fallback\n      queueId || this.prefixKey(hash),\n    ]);\n    if (rows && rows.length) {\n      return this.decodeQueryDefFromRow(rows[0], 'cancelQuery');\n    }\n\n    return null;\n  }\n","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-cubestore-driver/src/CubeStoreQueueDriver.ts#L146-L182","documentation":"CubeStoreQueueDriver.addToQueue expected the Cube Store QUEUE command to return at least one row; an empty rows array means the server responded without the queue entry data. The driver treats this as a protocol violation because a successful QUEUE call must always return the (possibly fast-tracked) queue status row. It throws a plain Error with the command name embedded for debugging.","triggerScenarios":"Calling addToQueue when Cube Store returns an empty result set for the QUEUE command — e.g. a Cube Store bug/regression, a corrupted or incompatible Cube Store version, or an intermediary (proxy) dropping the response rows.","commonSituations":"Running a mismatched Cube Store server version against a newer driver; network/proxy layers truncating flatbuffer responses; internal Cube Store failures returning empty payloads during queue operations.","solutions":["Verify the Cube Store server version matches what the driver expects and upgrade both together","Inspect Cube Store server logs at the time of the QUEUE command for internal errors","Retry the query; if reproducible, capture the command and open an issue with Cube/cube-store logs","Check for proxies/L4 load balancers between Cube and Cube Store that may truncate responses"],"exampleFix":"// before: driver throws on empty response\nthrow new Error(`Empty response on QUEUE ${command}`);\n// after: caller-side guard with retry\ntry {\n  await queueDriver.addToQueue(queryKey, queryDef, true);\n} catch (e) {\n  if (/Empty response on QUEUE/.test(e.message)) return retryAddToQueue();\n  throw e;\n}","handlingStrategy":"retry","validationCode":"// no pre-call validation available (server-side response); wrap the call\nif (!queueDriver) throw new Error('queue driver not initialized');","typeGuard":"const hasRows = (rows) => Array.isArray(rows) && rows.length > 0;","tryCatchPattern":"try {\n  await queueDriver.addToQueue(key, queryDef, true);\n} catch (e) {\n  if (e.message.startsWith('Empty response on QUEUE')) {\n    return retryWithBackoff(() => queueDriver.addToQueue(key, queryDef, true), 3);\n  }\n  throw e;\n}","preventionTips":["Keep Cube Store and cubejs-cubestore-driver versions aligned","Monitor Cube Store server logs for internal queue errors","Avoid proxies/LB between Cube and Cube Store that can truncate frames","Add alerting on this error to catch Cube Store regressions early"],"tags":["cubestore","queue","protocol-error"],"backgroundTag":"empty-response-on-queue","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}