remotion-dev/remotion · error · Error

If determining Cloudrun Url from serviceName, region must be

Error message

If determining Cloudrun Url from serviceName, region must be provided

What it means

Thrown by getCloudrunEndpoint() when serviceName is provided (and cloudRunUrl is not) but region is missing. The function must call getServiceInfo to resolve the URL, which requires a region to construct the fully-qualified service path.

Source

Thrown at packages/cloudrun/src/api/helpers/get-cloudrun-endpoint.ts:32

	serviceName,
	region,
}: getCloudrunEndpointInput): Promise<string> => {
	if (!cloudRunUrl && !serviceName)
		throw new Error('Either cloudRunUrl or serviceName must be provided');
	if (cloudRunUrl && serviceName)
		throw new Error(
			'Either cloudRunUrl or serviceName must be provided, not both',
		);

	let cloudRunEndpoint = '';
	if (cloudRunUrl) {
		validateCloudRunUrl(cloudRunUrl);
		cloudRunEndpoint = cloudRunUrl;
	}

	if (serviceName) {
		if (!region)
			throw new Error(
				'If determining Cloudrun Url from serviceName, region must be provided',
			);
		validateServiceName(serviceName);
		const validatedRegion = validateRegion(region);
		const {uri} = await getServiceInfo({serviceName, region: validatedRegion});
		cloudRunEndpoint = uri;
	}

	return cloudRunEndpoint;
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Pass region alongside serviceName.
  2. Validate region with validateRegion() before calling.

Example fix

// before
await getCloudrunEndpoint({serviceName: 'remotion-4.0.0-mem2'});
// after
await getCloudrunEndpoint({serviceName: 'remotion-4.0.0-mem2', region: 'us-central1'});
Defensive patterns

Strategy: validation

Validate before calling

if (opts.serviceName && !opts.region) {
  throw new Error('region required when using serviceName');
}
const validated = opts.region ? validateRegion(opts.region) : undefined;
await getCloudrunEndpoint({...opts, region: validated});

Type guard

const hasRegionForServiceName = (i) =>
  !i.serviceName || (typeof i.region === 'string' && i.region.length > 0);

Prevention

When it happens

Trigger: Calling getCloudrunEndpoint({serviceName: 'remotion-...'}) without a region field.

Common situations: Assuming the region can be inferred from the service name alone, or forgetting to forward region from the parent render call.

Related errors


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