remotion-dev/remotion · error · Error
The bucket ${bucketName}
Error message
The bucket ${bucketName} What it means
Thrown by validateBucketName() when the bucket name fails the GCS naming regex (3-63 chars, not a pure IP-like numeric dotted string, lowercase alphanumeric plus hyphens with no leading/trailing hyphens). The error message itself is truncated/incomplete ('The bucket <name> ' with no explanation) — a known weakness of this guard. It still signals an invalid GCS bucket name.
Source
Thrown at packages/cloudrun/src/shared/validate-bucketname.ts:32
`'bucketName' must be a string, but is ${JSON.stringify(bucketName)}`,
);
}
if (
options.mustStartWithRemotion &&
!bucketName.startsWith(REMOTION_BUCKET_PREFIX)
) {
throw new Error(
`The bucketName parameter must start with ${REMOTION_BUCKET_PREFIX}.`,
);
}
if (
!bucketName.match(
/^(?=^.{3,63}$)(?!^(\d+\.)+\d+$)(^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])$)/,
)
) {
throw new Error(`The bucket ${bucketName} `);
}
};
export const parseBucketName = (
name: string,
): {
region: GcpRegion | null;
} => {
const parsed = name.match(
new RegExp(`^${REMOTION_BUCKET_PREFIX}(.*)-([a-z0-9A-Z]+)$`),
);
const region = parsed?.[1] as GcpRegion;
if (!region) {
return {region: null};
}
const realRegionFound = GCP_REGIONS.find(View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Rename the bucket to lowercase letters, numbers, and hyphens only; length 3-63; no leading/trailing hyphens.
- Generate the name via `npx remotion cloudrun buckets create` to guarantee compliance.
- Cross-check against the GCS bucket naming rules before passing it in.
Example fix
// before
await deploySite({ bucketName: 'My_Remotion_Bucket', ... });
// after
await deploySite({ bucketName: 'remotioncloudrun-my-bucket', ... }); Defensive patterns
Strategy: validation
Validate before calling
const GCS_BUCKET_RE = /^(?=^.{3,63}$)(?!^(\d+\.)+\d+$)(^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])$)/;
if (!GCS_BUCKET_RE.test(bucketName)) throw new Error(`Invalid GCS bucket name: ${bucketName}`);
validateBucketName(bucketName, { mustStartWithRemotion: true }); Type guard
function isValidGcsBucketName(name: string): boolean {
return /^(?=^.{3,63}$)(?!^(\d+\.)+\d+$)(^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])$)/.test(name);
} Try / catch
// Validate before the API call; do not retry — name is deterministic.
Prevention
- Lowercase bucket names and use only hyphens as separators.
- Keep length in the 3-63 range; avoid leading/trailing hyphens.
- Generate compliant names with the Remotion CLI.
When it happens
Trigger: Passing a bucket name with uppercase letters, underscores, leading/trailing hyphens, fewer than 3 or more than 63 characters, or a dotted numeric (IP-like) form.
Common situations: Using camelCase or PascalCase bucket names; including forbidden characters like '_' or '.'; truncating or padding names to out-of-range lengths.
Related errors
- The bucketName parameter must start with ${REMOTION_BUCKET_P
- 'bucketName' must be a string, but is ${JSON.stringify(bucke
- The `project-id` must match the RegExp `/^[a-zA-Z][a-zA-Z0-9
- The `siteName` must match the RegExp `/^[-0-9a-zA-Z!_.*'()]+
- Folder name can only contain a-z, A-Z, 0-9 and -. You passed
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/02bb95c7f2f28952.
Report an issue: GitHub.