{"record":{"id":"5ba6bf8e6bba4071","repo":"remotion-dev/remotion","slug":"you-have-multiple-buckets-s-in-your-s3-region","errorCode":null,"errorMessage":"you have multiple buckets (%s) in your S3 region (%s) starting with %q. Please see https://remotion.dev/docs/lambda/multiple-buckets","messagePattern":"you have multiple buckets \\((.+?)\\) in your S3 region \\((.+?)\\) starting with %q\\. Please see https://remotion\\.dev/docs/lambda/multiple-buckets","errorType":"exception","errorClass":"error","httpStatus":null,"severity":"error","filePath":"packages/lambda-go/s3.go","lineNumber":125,"sourceCode":"\t\t\treturn nil, err\n\t\t}\n\t\tif isInRegion {\n\t\t\tbuckets = append(buckets, name)\n\t\t}\n\t}\n\treturn buckets, nil\n}\n\n// getOrCreateBucket returns the single existing Remotion bucket in the region,\n// creating one if none exist. It errors if multiple candidate buckets exist.\nfunc getOrCreateBucket(svc *s3.Client, region string) (string, error) {\n\tbuckets, err := getRemotionBuckets(svc, region)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif len(buckets) > 1 {\n\t\treturn \"\", fmt.Errorf(\n\t\t\t\"you have multiple buckets (%s) in your S3 region (%s) starting with %q. Please see https://remotion.dev/docs/lambda/multiple-buckets\",\n\t\t\tstrings.Join(buckets, \", \"), region, bucketNamePrefix,\n\t\t)\n\t}\n\tif len(buckets) == 1 {\n\t\treturn buckets[0], nil\n\t}\n\n\tbucket, err := makeBucketName(region)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tinput := &s3.CreateBucketInput{Bucket: new(bucket)}\n\tif region != regionUsEast1 {\n\t\tinput.CreateBucketConfiguration = &types.CreateBucketConfiguration{\n\t\t\tLocationConstraint: types.BucketLocationConstraint(region),\n\t\t}\n\t}","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-go/s3.go#L107-L143","documentation":"Returned by getOrCreateBucket when more than one bucket prefixed `remotionlambda-` exists in the configured region. The Remotion Lambda runtime expects exactly one such bucket per region; with multiple, it cannot decide which to use for input props and output, so it refuses rather than guessing. The message links to the docs page for resolving the situation.","triggerScenarios":"getRemotionBuckets returns 2+ entries for the region, which can happen after cross-account deployments, manual bucket creation, or two `deploy` runs that created buckets in parallel.","commonSituations":"An old bucket from a previous Remotion major version plus a new one created by a fresh deploy. A teammate manually created a `remotionlambda-` bucket. Deploying the same stack from multiple CI accounts into the same region.","solutions":["List buckets: `aws s3api list-buckets --query 'Buckets[?starts_with(Name,\\`remotionlambda-\\`)].Name'`, identify the one in use, and delete the other(s) after confirming they hold no needed renders.","Follow https://remotion.dev/docs/lambda/multiple-buckets for the official resolution steps.","Set an explicit bucket name in your config if the library supports it, so creation is deterministic and you can clean up the duplicates.","Audit who/what creates buckets in the account to prevent parallel deploys from creating a second bucket."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Preflight: ensure at most one Remotion bucket exists.\nfunc ensureSingleBucket(svc *s3.Client, region string) (string, error) {\n    buckets, err := getRemotionBuckets(svc, region)\n    if err != nil { return \"\", err }\n    if len(buckets) > 1 {\n        return \"\", fmt.Errorf(\"multiple buckets preflight: %s - clean up before render\", strings.Join(buckets, \", \"))\n    }\n    return getOrCreateBucket(svc, region)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `aws s3api list-buckets` after each deploy to catch duplicate buckets early.","Restrict who can create `remotionlambda-` buckets to a single deploy principal.","Reference a specific bucket name in config when supported to make creation deterministic."],"tags":["aws","s3","bucket","multi-bucket","config","go","lambda-go"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}