cube-js/cube · error
Job ${jobId} has been canceled
Error message
Job ${jobId} has been canceled What it means
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.
Source
Thrown at packages/cubejs-dremio-driver/driver/DremioDriver.js:183
headers: {
Authorization: token
},
data,
});
}
/**
* @protected
*/
async getJobStatus(jobId) {
const { data } = await this.restDremioQuery('get', `/job/${jobId}`);
if (data.jobState === 'FAILED') {
throw new Error(data.errorMessage);
}
if (data.jobState === 'CANCELED') {
throw new Error(`Job ${jobId} has been canceled`);
}
if (data.jobState === 'COMPLETED') {
return data;
}
return null;
}
/**
* @protected
*/
async getJobResults(jobId, limit = 500, offset = 0) {
return this.restDremioQuery('get', `/job/${jobId}/results?offset=${offset}&limit=${limit}`);
}
/**
* @protectedView on GitHub (pinned to 7d981676b3)
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
Defensive patterns
Strategy: retry
Try / catch
try {
return await driver.query(sql, params);
} catch (e) {
if (/has been canceled/.test(e.message)) {
// transient: optionally retry once after a delay, then surface to user
await delay(5000);
return driver.query(sql, params);
}
throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- ${data.errorMessage}
- DremioQuery job timeout reached ${this.config.pollTimeout}ms
- Query was cancelled
- CancelToken was already canceled
- ${result.status.errorResult.message ? result.status.errorRes
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/5dc6cba3d0a87aff.
Report an issue: GitHub.