{"record":{"id":"ba56277757c83813","repo":"cube-js/cube","slug":"field-payload-is-empty-incorrect-response-for-m","errorCode":null,"errorMessage":"Field payload is empty, incorrect response for ${method} method","messagePattern":"Field payload is empty, incorrect response for (.+?) method","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-cubestore-driver/src/CubeStoreQueueDriver.ts","lineNumber":310,"sourceCode":"      parseInt(row.queue_id, 10),\n    ]);\n  }\n\n  public async getQueriesToCancel(): Promise<QueryKeysTuple[]> {\n    const rows = await this.driver.query<CubeStoreListResponse>('QUEUE TO_CANCEL ? ? ?', [\n      this.options.heartBeatTimeout * 1000,\n      this.options.orphanedTimeout * 1000,\n      this.options.redisQueuePrefix,\n    ]);\n    return rows.map((row) => [\n      row.id as QueryKeyHash,\n      parseInt(row.queue_id, 10),\n    ]);\n  }\n\n  protected decodeQueryDefFromRow(row: { payload: string, extra?: string | null }, method: string): QueryDef {\n    if (!row.payload) {\n      throw new Error(`Field payload is empty, incorrect response for ${method} method`);\n    }\n\n    const payload = JSON.parse(row.payload);\n\n    if (row.extra) {\n      return Object.assign(payload, JSON.parse(row.extra));\n    }\n\n    return payload;\n  }\n\n  public async getQueryDef(hash: QueryKeyHash, queueId: QueueId | null): Promise<QueryDef | null> {\n    const rows = await this.driver.query('QUEUE GET ?', [\n      queueId || this.prefixKey(hash),\n    ]);\n    if (rows && rows.length) {\n      return this.decodeQueryDefFromRow(rows[0], 'getQueryDef');\n    }","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-cubestore-driver/src/CubeStoreQueueDriver.ts#L292-L328","documentation":"decodeQueryDefFromRow parses the payload column of a queue-status row returned by Cube Store; if payload is empty/null the row cannot be decoded into a QueryDef. The driver throws rather than silently returning a broken query definition. The method name is embedded in the message to identify which queue API call produced the bad row.","triggerScenarios":"cancelQuery, getQueryStageState, getResult, getQueryDef, getResultBlocking, or decodeRetrievedFromRow receiving a row with an empty payload column — typically a row created without a payload or a response from an incompatible Cube Store schema.","commonSituations":"Cube Store upgraded/downgraded so queue table rows have a different payload format; rows written by an older server being read by a newer driver; corrupted queue state after a crash.","solutions":["Check Cube Store and Cube driver version compatibility and align versions","Inspect the cube-store internal queue table for rows with NULL payload","Clear/rebuild Cube Store queue state (restart Cube Store; remove orphaned queue entries if safe)","If reproducible, report with the method name from the message and server logs"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// inspect queue rows yourself if reading cube-store internals\nif (!row || !row.payload) throw new Error('queue row missing payload');","typeGuard":"const hasPayload = (row) => typeof row?.payload === 'string' && row.payload.length > 0;","tryCatchPattern":"try {\n  const def = await queueDriver.getQueryDef(key);\n} catch (e) {\n  if (/Field payload is empty/.test(e.message)) {\n    // treat as missing/invalid queue entry; purge state or resubmit the query\n    return resubmitQuery(key);\n  }\n  throw e;\n}","preventionTips":["Upgrade Cube Store and driver together to keep the payload schema compatible","Restart Cube Store after crashes to rebuild queue state","Don't read queue tables across version-skewed deployments","Alert on this error as an indicator of protocol/version drift"],"tags":["cubestore","queue","deserialization"],"backgroundTag":"empty-payload-field","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}