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

  1. Refresh the Studio render-queue UI and re-check the job's status before cancelling.
  2. Only expose the Cancel action for jobs whose status === 'running'.
  3. If using the API programmatically, guard the call with a status check (see defense).
  4. 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

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


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/d61f77702ff2b821. Report an issue: GitHub.