remotion-dev/remotion · error · Error

Cannot cancel render ${input.renderId}: The render was not s

Error message

Cannot cancel render ${input.renderId}: The render was not started with enableCancellation: true.

What it means

internalCancelRenderOnLambda first fetches the render's progress.json from S3 and refuses to cancel when its cancellationEnabled flag is not exactly true. Cancellation is opt-in per render because it adds a progress-polling overhead; only renders started with `enableCancellation: true` (CLI `--enable-cancellation`) can later be cancelled via cancelRenderOnLambda.

Source

Thrown at packages/lambda-client/src/cancel-render-on-lambda.ts:44

export const internalCancelRenderOnLambda = async (
	input: InternalCancelRenderOnLambdaInput,
): Promise<void> => {
	const expectedBucketOwner = await input.providerSpecifics.getAccountId({
		region: input.region,
	});
	const progress = await getOverallProgressFromStorage({
		bucketName: input.bucketName,
		expectedBucketOwner,
		region: input.region,
		renderId: input.renderId,
		providerSpecifics: input.providerSpecifics,
		forcePathStyle: input.forcePathStyle,
		requestHandler: input.requestHandler,
	});

	if (progress.cancellationEnabled !== true) {
		throw new Error(
			`Cannot cancel render ${input.renderId}: The render was not started with enableCancellation: true.`,
		);
	}

	await writeCancellationSignal({
		bucketName: input.bucketName,
		renderId: input.renderId,
		region: input.region,
		expectedBucketOwner,
		providerSpecifics: input.providerSpecifics,
		forcePathStyle: input.forcePathStyle,
		requestHandler: input.requestHandler,
	});
};

/*
 * @description Cancels an in-progress render that was started with enableCancellation: true.
 * @see [Documentation](https://remotion.dev/docs/lambda/cancelrenderonlambda)

View on GitHub (pinned to 10db9de073)

Solutions

  1. Start renders you may need to cancel with `enableCancellation: true` (CLI: `--enable-cancellation`).
  2. For an already-running non-cancellable render, wait for it to finish or delete its artifacts / let the retention period reap it; it cannot be cancelled retroactively.
  3. Propagate the flag through your render API so client-initiated cancels are possible.

Example fix

// before
await renderMediaOnLambda({composition: 'my-video', /* no enableCancellation */});
await cancelRenderOnLambda({renderId}); // throws

// after
await renderMediaOnLambda({composition: 'my-video', enableCancellation: true});
await cancelRenderOnLambda({renderId});
Defensive patterns

Strategy: try-catch

Validate before calling

// At render start, persist whether cancellation was enabled so the UI can disable the cancel button
const {renderId} = await renderMediaOnLambda({..., enableCancellation: true});
// store renderId with cancellation: true; only offer cancel for those renders

Try / catch

try {
  await cancelRenderOnLambda({renderId, region, bucketName});
} catch (e) {
  if (e instanceof Error && e.message.includes('enableCancellation')) {
    // render is not cancellable: mark as uncancellable in UI, do not retry
  } else throw e;
}

Prevention

When it happens

Trigger: Calling `cancelRenderOnLambda({renderId, ...})` (or pressing Ctrl+C on a CLI render, which routes through the same code via unregisterCtrlCHandler) for a render that was started without `enableCancellation: true`.

Common situations: Adding a cancel button to an app for renders that were never started with cancellation enabled; upgrading a pipeline that predates the option and forgetting to set it at start time.

Related errors


AI-assisted analysis of remotion-dev/remotion@10db9de073 (2026-08-22). Data as JSON: /api/errors/6cc1f35c43869005. Report an issue: GitHub.