cube-js/cube · error

Field payload is empty, incorrect response for

Error message

Field payload is empty, incorrect response for ${method} method

What it means

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.

Solutions

  1. Check Cube Store and Cube driver version compatibility and align versions
  2. Inspect the cube-store internal queue table for rows with NULL payload
  3. Clear/rebuild Cube Store queue state (restart Cube Store; remove orphaned queue entries if safe)
  4. If reproducible, report with the method name from the message and server logs
Defensive patterns

Strategy: try-catch

Validate before calling

// inspect queue rows yourself if reading cube-store internals
if (!row || !row.payload) throw new Error('queue row missing payload');

Type guard

const hasPayload = (row) => typeof row?.payload === 'string' && row.payload.length > 0;

Try / catch

try {
  const def = await queueDriver.getQueryDef(key);
} catch (e) {
  if (/Field payload is empty/.test(e.message)) {
    // treat as missing/invalid queue entry; purge state or resubmit the query
    return resubmitQuery(key);
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/ba56277757c83813. Report an issue: GitHub.

Appendix: source

Thrown at packages/cubejs-cubestore-driver/src/CubeStoreQueueDriver.ts:310

      parseInt(row.queue_id, 10),
    ]);
  }

  public async getQueriesToCancel(): Promise<QueryKeysTuple[]> {
    const rows = await this.driver.query<CubeStoreListResponse>('QUEUE TO_CANCEL ? ? ?', [
      this.options.heartBeatTimeout * 1000,
      this.options.orphanedTimeout * 1000,
      this.options.redisQueuePrefix,
    ]);
    return rows.map((row) => [
      row.id as QueryKeyHash,
      parseInt(row.queue_id, 10),
    ]);
  }

  protected decodeQueryDefFromRow(row: { payload: string, extra?: string | null }, method: string): QueryDef {
    if (!row.payload) {
      throw new Error(`Field payload is empty, incorrect response for ${method} method`);
    }

    const payload = JSON.parse(row.payload);

    if (row.extra) {
      return Object.assign(payload, JSON.parse(row.extra));
    }

    return payload;
  }

  public async getQueryDef(hash: QueryKeyHash, queueId: QueueId | null): Promise<QueryDef | null> {
    const rows = await this.driver.query('QUEUE GET ?', [
      queueId || this.prefixKey(hash),
    ]);
    if (rows && rows.length) {
      return this.decodeQueryDefFromRow(rows[0], 'getQueryDef');
    }

View on GitHub (pinned to 7d981676b3)