{"record":{"id":"86612f4b1188d48f","repo":"remotion-dev/remotion","slug":"you-have-multiple-buckets-remotionbuckets","errorCode":null,"errorMessage":"You have multiple buckets (${remotionBuckets\n\t\t\t\t.map((b) => b.name)\n\t\t\t\t.join(', ')}) in your Cloud Storage region (${\n\t\t\tparams.region\n\t\t}) starting with \"${REMOTION_BUCKET_PREFIX}\". This is an error, please delete buckets so that you have one maximum.","messagePattern":"You have multiple buckets \\((.+?)\\) in your Cloud Storage region \\((.+?)\\) starting with \"(.+?)\"\\. This is an error, please delete buckets so that you have one maximum\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cloudrun/src/api/get-or-create-bucket.ts","lineNumber":32,"sourceCode":"\t\t\t| 'Used bucket',\n\t) => void;\n};\n\nexport type GetOrCreateBucketOutput = {\n\tbucketName: string;\n\talreadyExisted: boolean;\n};\n/*\n * @description Creates a Cloud Storage bucket for Remotion Cloud Run in your GCP project. If one already exists, it will get returned instead.\n * @see [Documentation](https://remotion.dev/docs/cloudrun/getorcreatebucket)\n */\nexport const getOrCreateBucket = async (\n\tparams: GetOrCreateBucketInput,\n): Promise<GetOrCreateBucketOutput> => {\n\tconst {remotionBuckets} = await getRemotionStorageBuckets(params.region);\n\n\tif (remotionBuckets.length > 1) {\n\t\tthrow new Error(\n\t\t\t`You have multiple buckets (${remotionBuckets\n\t\t\t\t.map((b) => b.name)\n\t\t\t\t.join(', ')}) in your Cloud Storage region (${\n\t\t\t\tparams.region\n\t\t\t}) starting with \"${REMOTION_BUCKET_PREFIX}\". This is an error, please delete buckets so that you have one maximum.`,\n\t\t);\n\t}\n\n\tif (remotionBuckets.length === 1) {\n\t\tparams?.updateBucketState?.('Used bucket');\n\t\treturn {\n\t\t\tbucketName: remotionBuckets[0].name,\n\t\t\talreadyExisted: true,\n\t\t};\n\t}\n\n\tif (params?.region) {\n\t\tparams.updateBucketState?.('Creating bucket');","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/cloudrun/src/api/get-or-create-bucket.ts#L14-L50","documentation":"Thrown by getOrCreateBucket() when more than one Cloud Storage bucket with the 'remotion-' prefix exists in the target GCP region. Remotion Cloud Run requires exactly one such bucket per region to store renders, serve URLs, and intermediates. Having multiple ambiguous buckets prevents the SDK from deterministically choosing the correct one.","triggerScenarios":"Calling getOrCreateBucket({region}) (directly or via deploy/render APIs that internally call it) when getRemotionStorageBuckets(region) returns a remotionBuckets array with length > 1.","commonSituations":"Running getOrCreateBucket multiple times in parallel (race), manually creating remotion-* buckets, or running deploy in a region that already has a leftover bucket from a previous deployment without cleanup.","solutions":["List your remotion-* buckets in the region with gsutil or the GCP console and delete all but one.","Delete all remotion-* buckets in the region and let getOrCreateBucket recreate a single canonical one.","Avoid concurrent getOrCreateBucket calls in the same region; serialize deploys per region."],"exampleFix":"// before: two remotion-* buckets exist in us-central1\n// after: delete the extras\n// gcloud storage rm -r gs://remotion-<id-to-remove>\n// then re-run getOrCreateBucket({region: 'us-central1'})","handlingStrategy":"validation","validationCode":"import {getRemotionStorageBuckets} from '@remotion/cloudrun';\n\nconst {remotionBuckets} = await getRemotionStorageBuckets(region);\nif (remotionBuckets.length > 1) {\n  console.warn('Multiple remotion buckets found:', remotionBuckets.map(b => b.name));\n  // prompt user to delete extras before calling getOrCreateBucket\n}","typeGuard":null,"tryCatchPattern":"try {\n  await getOrCreateBucket({region});\n} catch (e) {\n  if (e.message.includes('multiple buckets')) {\n    // list and surface bucket names for cleanup\n  }\n  throw e;\n}","preventionTips":["Run exactly one deploy orchestrator per region at a time to avoid concurrent bucket creation.","Periodically clean up orphaned remotion-* buckets via the GCP console.","Document the canonical bucket name for each region in your team's runbook."],"tags":["cloudrun","gcp","storage","bucket","configuration"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}