{"record":{"id":"49a49122fe425b51","repo":"cube-js/cube","slug":"data-errormessage","errorCode":null,"errorMessage":"${data.errorMessage}","messagePattern":"\\$\\{data\\.errorMessage\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-dremio-driver/driver/DremioDriver.js","lineNumber":179,"sourceCode":"\n    return axios.request({\n      method,\n      url: `${this.config.url}${this.config.apiVersion}${url}`,\n      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}`);","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-dremio-driver/driver/DremioDriver.js#L161-L197","documentation":"getJobStatus polls the Dremio REST API for a submitted query job. Dremio reports jobState FAILED with an errorMessage; the driver re-throws that server-side message verbatim as a generic Error, so the text is whatever Dremio reported for the failed job.","triggerScenarios":"Executing a query via DremioDriver.query/job where the Dremio job enters jobState 'FAILED' — e.g. SQL syntax error, nonexistent dataset/source, permission denied on the source, out-of-memory, or source connectivity failure inside Dremio.","commonSituations":"Broken/renamed datasets after schema changes in Dremio; revoked user permissions on a source; reflection issues; invalid PDS path; Dremio coordinator unable to reach the executor/storage plugin.","solutions":["Read the accompanying data.errorMessage for the actual Dremio failure reason and fix the query or dataset accordingly","Validate the SQL and referenced dataset paths against Dremio directly (run the query in the Dremio UI)","Check source permissions for the user whose credentials/token the driver uses","Check Dremio job profiles (Jobs UI) for detailed failure diagnostics","Verify the source plugin (e.g. S3, Postgres) is healthy in Dremio"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// verify the dataset exists before running\nconst catalog = await driver.restDremioQuery('get', `/catalog/by-path/${encodedPath}`);\nif (!catalog.data) throw new Error('Dataset path not found in Dremio');","typeGuard":null,"tryCatchPattern":"try {\n  const rows = await driver.query(sql, params);\n} catch (e) {\n  console.error('Dremio job failed:', e.message); // message is Dremio's errorMessage\n  // inspect Dremio Jobs UI for the job profile, then fix query/permissions\n}","preventionTips":["Run queries in the Dremio UI first to validate SQL and dataset paths","Grant the driver's user/token access to all referenced sources","Keep dataset paths in sync with Dremio schema changes","Monitor Dremio job failures and set alerts on FAILED job states"],"tags":["dremio","sql","remote-error","query-execution"],"backgroundTag":"query-execution-failed","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}