{"record":{"id":"02bb95c7f2f28952","repo":"remotion-dev/remotion","slug":"the-bucket-bucketname","errorCode":null,"errorMessage":"The bucket ${bucketName} ","messagePattern":"The bucket (.+?) ","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/src/shared/validate-bucketname.ts","lineNumber":32,"sourceCode":"\t\t\t`'bucketName' must be a string, but is ${JSON.stringify(bucketName)}`,\n\t\t);\n\t}\n\n\tif (\n\t\toptions.mustStartWithRemotion &&\n\t\t!bucketName.startsWith(REMOTION_BUCKET_PREFIX)\n\t) {\n\t\tthrow new Error(\n\t\t\t`The bucketName parameter must start with ${REMOTION_BUCKET_PREFIX}.`,\n\t\t);\n\t}\n\n\tif (\n\t\t!bucketName.match(\n\t\t\t/^(?=^.{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])$)/,\n\t\t)\n\t) {\n\t\tthrow new Error(`The bucket ${bucketName} `);\n\t}\n};\n\nexport const parseBucketName = (\n\tname: string,\n): {\n\tregion: GcpRegion | null;\n} => {\n\tconst parsed = name.match(\n\t\tnew RegExp(`^${REMOTION_BUCKET_PREFIX}(.*)-([a-z0-9A-Z]+)$`),\n\t);\n\tconst region = parsed?.[1] as GcpRegion;\n\n\tif (!region) {\n\t\treturn {region: null};\n\t}\n\n\tconst realRegionFound = GCP_REGIONS.find(","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/shared/validate-bucketname.ts#L14-L50","documentation":"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.","triggerScenarios":"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.","commonSituations":"Using camelCase or PascalCase bucket names; including forbidden characters like '_' or '.'; truncating or padding names to out-of-range lengths.","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."],"exampleFix":"// before\nawait deploySite({ bucketName: 'My_Remotion_Bucket', ... });\n// after\nawait deploySite({ bucketName: 'remotioncloudrun-my-bucket', ... });","handlingStrategy":"validation","validationCode":"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])$)/;\nif (!GCS_BUCKET_RE.test(bucketName)) throw new Error(`Invalid GCS bucket name: ${bucketName}`);\nvalidateBucketName(bucketName, { mustStartWithRemotion: true });","typeGuard":"function isValidGcsBucketName(name: string): boolean {\n  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);\n}","tryCatchPattern":"// Validate before the API call; do not retry — name is deterministic.","preventionTips":["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."],"tags":["cloudrun","validation","bucket","naming","regex"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}