remotion-dev/remotion · error · Error

Bucket creation is required, but no region has been passed.

Error message

Bucket creation is required, but no region has been passed.

What it means

Thrown by getOrCreateBucket() when the function reaches the end of its control flow without having an existing bucket or sufficient parameters to create one. The code returns an existing bucket if remotionBuckets.length === 1, otherwise it attempts creation which requires params.region. If neither path executes, the final throw is reached.

Source

Thrown at packages/cloudrun/src/api/get-or-create-bucket.ts:63

			alreadyExisted: true,
		};
	}

	if (params?.region) {
		params.updateBucketState?.('Creating bucket');

		const bucketName = makeBucketName();
		await createBucket({
			bucketName,
			region: params.region,
		});

		params.updateBucketState?.('Created bucket');

		return {bucketName, alreadyExisted: false};
	}

	throw new Error(
		'Bucket creation is required, but no region has been passed.',
	);
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Ensure params.region is a valid GcpRegion before calling getOrCreateBucket.
  2. Run validateRegion(params.region) at the caller before invoking this API.
  3. Check that any environment variable sourcing the region is set and non-empty.

Example fix

// before
await getOrCreateBucket({region: undefined});
// after
import {validateRegion} from '@remotion/cloudrun';
await getOrCreateBucket({region: validateRegion(process.env.GCP_REGION)});
Defensive patterns

Strategy: validation

Validate before calling

if (!params?.region) {
  throw new Error('region is required for getOrCreateBucket');
}
const validated = validateRegion(params.region);
await getOrCreateBucket({region: validated});

Type guard

const hasRegion = (p): p is {region: string} =>
  typeof p?.region === 'string' && p.region.length > 0;

Prevention

When it happens

Trigger: Calling getOrCreateBucket with params where region is undefined/null/empty, and no pre-existing remotion bucket is found in that region, so the creation branch runs createBucket without a valid region or falls through to the final throw.

Common situations: Passing an object missing the region field, or passing region: undefined due to an env var not being set. The GetOrCreateBucketInput type requires region, so this typically means a caller bypassed type checks or a prior step failed to validate.

Related errors


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