cube-js/cube · error

${result.error}

Error message

${result.error}

What it means

parseResult unwraps the raw result object returned from the query handler; when the result carries an `error` property it re-throws it as a plain Error. This is the queue's generic pass-through for any driver/execution failure, so the message is whatever the underlying system reported (the TODO comment notes this is a raw propagation).

Source

Thrown at packages/cubejs-query-orchestrator/src/orchestrator/QueryQueue.ts:429

      }
    });

    return { promise, dispose };
  }

  /**
   * @throw {Error}
   */
  protected parseResult(result: any): any {
    if (!result) {
      return;
    }
    if (result instanceof QueryStream) {
      // eslint-disable-next-line consistent-return
      return result;
    }
    if (result.error) {
      throw new Error(result.error); // TODO
    } else {
      // eslint-disable-next-line consistent-return
      return result.result;
    }
  }

  protected reconcileAgain: boolean = false;

  protected reconcilePromise: Promise<void> | null = null;

  /**
   * Run query queue reconciliation flow by calling internal `reconcileQueueImpl`
   * method. Returns promise which will be resolved with the reconciliation
   * result.
   */
  public async reconcileQueue(): Promise<void> {
    if (!this.reconcilePromise) {
      this.reconcileAgain = false;

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Read result.error in the message to find the root cause and fix the underlying query/driver issue
  2. Enable request logging (requestContext / logger) to capture the original query that failed
  3. Wrap executeInQueue calls and branch on the error message for retryable vs permanent failures

Example fix

// before
const result = await queue.executeInQueue('query', key, query, 0, options);
// after
let result;
try {
  result = await queue.executeInQueue('query', key, query, 0, options);
} catch (e) {
  console.error('Queued query failed:', e.message);
  throw e;
}
Defensive patterns

Strategy: try-catch

Try / catch

try { return await queue.executeInQueue(handler, key, query, priority, opts); } catch (e) { logger.error({ queryKey: key, error: e.message }); throw e; }

Prevention

When it happens

Trigger: Any queued query whose execution result contains { error: ... } — driver failures, Cube Store errors, SQL errors surfaced through processQuerySkipQueue and then parseResult via executeInQueue.

Common situations: Bad SQL generated by a misconfigured schema; Cube Store returning an execution error; driver connection failures during a queued query.

Related errors


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