cube-js/cube · error

Lambda query errors ${errors.join(', ')}

Error message

Lambda query errors ${errors.join(', ')}

What it means

In QueryCache.csvQuery, the streaming pipeline (rowStream -> csv writer) collects any pipeline errors and, if any occurred, throws a combined 'Lambda query errors ...' message listing them. It aggregates failures from streaming pre-aggregation/lambda query rows — typically driver-level stream errors, serialization failures, or premature stream termination — into one error for the queue caller (getQueue).

Source

Thrown at packages/cubejs-query-orchestrator/src/orchestrator/QueryCache.ts:697

  protected async csvQuery(client, q) {
    const headers = q.lambdaTypes.map(c => c.name);
    const writer = csvWriter({
      headers,
      sendHeaders: false,
    });
    let tableData;
    try {
      if (client.stream) {
        tableData = await client.stream(q.query, q.values, q);
        const errors = [];
        await pipeline(tableData.rowStream, writer, (err) => {
          if (err) {
            errors.push(err);
          }
        });
        if (errors.length > 0) {
          throw new Error(`Lambda query errors ${errors.join(', ')}`);
        }
      } else {
        tableData = await client.downloadQueryResults(q.query, q.values, q);
        tableData.rows.forEach(
          row => writer.write(row)
        );
        writer.end();
      }
    } finally {
      if (tableData?.release) {
        await tableData.release();
      }
    }
    const lines = await streamToArray(writer);
    const rowCount = lines.length;
    const csvRows = lines.join('');
    return {
      types: q.lambdaTypes,

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Inspect the collected pipeline errors — they usually indicate the destination stream (CSV writer/upload) failed mid-flight, not the query itself
  2. Check for premature stream close, disk-full, or Cube Store upload failures in the error chain and fix the downstream sink
  3. If the row stream aborted due to the source driver, look at the driver-level error wrapped inside errors[]
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/cubejs-query-orchestrator/src/orchestrator/QueryCache.ts:697 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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