{"record":{"id":"82c1438820808f78","repo":"cube-js/cube","slug":"dremioquery-job-timeout-reached-this-config-poll","errorCode":null,"errorMessage":"DremioQuery job timeout reached ${this.config.pollTimeout}ms","messagePattern":"DremioQuery job timeout reached (.+?)ms","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-dremio-driver/driver/DremioDriver.js","lineNumber":240,"sourceCode":"\n        for (let offset = 0; offset < job.rowCount; offset += DREMIO_JOB_LIMIT) {\n          queries.push(this.getJobResults(jobId, DREMIO_JOB_LIMIT, offset));\n        }\n\n        const results = await Promise.all(queries);\n\n        return results.reduce(\n          (result, { data }) => result.concat(data.rows),\n          []\n        );\n      }\n\n      await pausePromise(\n        Math.min(this.config.pollMaxInterval, 200 * i),\n      );\n    }\n\n    throw new Error(\n      `DremioQuery job timeout reached ${this.config.pollTimeout}ms`,\n    );\n  }\n\n  async refreshTablesSchema(path) {\n    const { data } = await this.restDremioQuery('get', `/catalog/by-path/${path}`);\n    if (!data || !data.children) {\n      return true;\n    }\n\n    const queries = data.children.map(element => {\n      const url = element.path.join('/');\n      return this.refreshTablesSchema(url);\n    });\n\n    return Promise.all(queries);\n  }\n","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-dremio-driver/driver/DremioDriver.js#L222-L258","documentation":"DremioDriver.query polls the job status until COMPLETED, FAILED, or CANCELED, sleeping with growing intervals until this.config.pollTimeout (default pollMaxInterval capped pacing) elapses. If the job is still running after pollTimeout milliseconds, the driver gives up and throws this timeout Error.","triggerScenarios":"Long-running Dremio queries (large scans, no reflections, heavy cluster load) whose Dremio job exceeds the configured pollTimeout while remaining in RUNNING state.","commonSituations":"Queries on large datasets without pre-aggregations/reflections; overloaded Dremio cluster with queued jobs; too-low pollTimeout for analytics workloads; executor node down making jobs stall.","solutions":["Increase pollTimeout in the DremioDriver config (e.g. pollTimeout: '10 minutes')","Optimize the query / create Dremio reflections to shorten execution time","Check Dremio cluster health and executor availability for stalled jobs","Enable Cube pre-aggregations so heavy queries don't hit Dremio repeatedly","Reduce concurrent load so Dremio queueing doesn't exceed the timeout"],"exampleFix":"// before\nnew DremioDriver({ ...config, pollTimeout: '30 seconds' })\n// after\nnew DremioDriver({ ...config, pollTimeout: '10 minutes' })","handlingStrategy":"retry","validationCode":"// ensure pollTimeout comfortably exceeds expected query duration\nif (parseDuration(config.pollTimeout) < 300000) {\n  console.warn('pollTimeout under 5 minutes may time out on large Dremio queries');\n}","typeGuard":null,"tryCatchPattern":"try {\n  return await driver.query(sql, params);\n} catch (e) {\n  if (/job timeout reached/.test(e.message)) {\n    // check Dremio job state before retrying; back off and retry once\n    await delay(30000);\n    return driver.query(sql, params);\n  }\n  throw e;\n}","preventionTips":["Set pollTimeout generously (e.g. 10+ minutes) for analytical workloads","Create reflections/pre-aggregations to keep query times short","Monitor Dremio cluster health and executor availability","Avoid issuing excessive concurrent long queries against Dremio"],"tags":["dremio","timeout","query-execution","polling"],"backgroundTag":"query-timeout","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}