{"record":{"id":"5dc6cba3d0a87aff","repo":"cube-js/cube","slug":"job-jobid-has-been-canceled","errorCode":null,"errorMessage":"Job ${jobId} has been canceled","messagePattern":"Job (.+?) has been canceled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-dremio-driver/driver/DremioDriver.js","lineNumber":183,"sourceCode":"      headers: {\n        Authorization: token\n      },\n      data,\n    });\n  }\n\n  /**\n   * @protected\n   */\n  async getJobStatus(jobId) {\n    const { data } = await this.restDremioQuery('get', `/job/${jobId}`);\n\n    if (data.jobState === 'FAILED') {\n      throw new Error(data.errorMessage);\n    }\n\n    if (data.jobState === 'CANCELED') {\n      throw new Error(`Job ${jobId} has been canceled`);\n    }\n\n    if (data.jobState === 'COMPLETED') {\n      return data;\n    }\n\n    return null;\n  }\n\n  /**\n   * @protected\n   */\n  async getJobResults(jobId, limit = 500, offset = 0) {\n    return this.restDremioQuery('get', `/job/${jobId}/results?offset=${offset}&limit=${limit}`);\n  }\n\n  /**\n   * @protected","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-dremio-driver/driver/DremioDriver.js#L165-L201","documentation":"When polling a Dremio job, a jobState of CANCELED means the job was aborted on the Dremio side (by a user, a timeout, or Dremio itself). getJobStatus throws this Error naming the canceled jobId, aborting the query.","triggerScenarios":"A query submitted through DremioDriver where the Dremio job is canceled before reaching COMPLETED: manual cancellation in the Dremio UI/API, Dremio killing long-running jobs, admin-imposed kill on resource-heavy queries.","commonSituations":"DBA canceling runaway queries; jobs exceeding Dremio's resource limits; duplicate Cube orchestrator queries superseded and canceled externally; shared cluster where operators cancel expensive jobs.","solutions":["Investigate why the job was canceled (Dremio job profile shows who/what canceled it)","Optimize the query or add reflections so it completes before being killed","Re-run the query; cancellations can be one-off operator actions","Align Dremio resource/queue limits so Cube's workloads aren't automatically canceled"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return await driver.query(sql, params);\n} catch (e) {\n  if (/has been canceled/.test(e.message)) {\n    // transient: optionally retry once after a delay, then surface to user\n    await delay(5000);\n    return driver.query(sql, params);\n  }\n  throw e;\n}","preventionTips":["Optimize heavy queries so they finish before operators cancel them","Add Dremio reflections to shorten execution time","Coordinate query-cancellation policies with the Dremio admin team","Log the jobId from context so canceled jobs can be traced"],"tags":["dremio","query-execution","cancellation","remote-error"],"backgroundTag":"query-canceled","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}