remotion-dev/remotion · error · Error
Job is not running
Error message
Job is not running
What it means
Thrown by cancelJob in the Studio render queue when the located job's status is not 'running'. The queue only allows cancelling an actively executing job; queued, completed, failed, or cleaned-up jobs have no live cancelToken to invoke.
Source
Thrown at packages/cli/src/render-queue/queue.ts:132
export const removeJob = (jobId: string) => {
jobQueue = jobQueue.filter((job) => {
if (job.id === jobId) {
job.cleanup.forEach((c) => {
c();
});
return false;
}
return true;
});
notifyClientsOfJobUpdate();
};
export const cancelJob = (jobId: string) => {
for (const job of jobQueue) {
if (job.id === jobId) {
if (job.status !== 'running') {
throw new Error('Job is not running');
}
job.cancelToken.cancel();
break;
}
}
};
const processJobIfPossible = async ({
remotionRoot,
entryPoint,
logLevel,
fixedConfig,
}: {
remotionRoot: string;
entryPoint: string;
logLevel: LogLevel;
fixedConfig: StudioRenderJobFixedConfig;View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Refresh the Studio render-queue UI and re-check the job's status before cancelling.
- Only expose the Cancel action for jobs whose status === 'running'.
- If using the API programmatically, guard the call with a status check (see defense).
- For removing non-running jobs use removeJob instead of cancelJob.
Example fix
// before - unconditional cancel
import {cancelJob} from '@remotion/cli/render-queue/queue';
cancelJob(jobId);
// after - guard on status
import {cancelJob, getJobs} from '@remotion/cli/render-queue/queue';
const job = getJobs().find(j => j.id === jobId);
if (job && job.status === 'running') {
cancelJob(jobId);
} Defensive patterns
Strategy: type-guard
Validate before calling
const safeCancel = (jobId: string) => {
const job = jobQueue.find((j) => j.id === jobId);
if (!job) return; // already removed
if (job.status !== 'running') return; // nothing to cancel
cancelJob(jobId);
};
safeCancel(jobId); Type guard
const isJobRunning = (job: {status: string} | undefined): job is {status: 'running'} =>
!!job && job.status === 'running'; Try / catch
try {
cancelJob(jobId);
} catch (err) {
if (err instanceof Error && err.message === 'Job is not running') {
// benign - job already finished; refresh UI
return;
}
throw err;
} Prevention
- Only show the Cancel control for jobs with status === 'running'.
- Handle the 'Job is not running' message as benign in UI handlers.
- Use removeJob to discard finished/queued jobs.
When it happens
Trigger: The Studio UI (or a programmatic caller of cancelJob) sends a cancel request for a job that is still queued, already finished, already cancelled, or already removed. Also a race where the job transitions out of running between the UI render and the cancel click.
Common situations: Double-clicking Cancel; cancelling a job that just finished; UI state out of sync with the server-side queue; a job that errored before being marked running.
Related errors
- ${oldRelativePath} does not exist
- The config format has changed. Change `Config.Preview.*()` c
- Studio server port should be a number. Got ${typeof port} ($
- Studio server port should be a number between 1 and 65535. G
- getStaticFiles() has moved into the `@remotion/studio` packa
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/d61f77702ff2b821.
Report an issue: GitHub.