{"record":{"id":"4e36caeae178e2b6","repo":"remotion-dev/remotion","slug":"you-have-multiple-buckets-s-in-your-s3-region-4e36ca","errorCode":null,"errorMessage":"You have multiple buckets (%s) in your S3 region (%s) starting with \"remotionlambda-\". Please see https://remotion.dev/docs/lambda/multiple-buckets.","messagePattern":"You have multiple buckets \\((.+?)\\) in your S3 region \\((.+?)\\) starting with \"remotionlambda-\"\\. Please see https://remotion\\.dev/docs/lambda/multiple-buckets\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"packages/lambda-php/src/PHPClient.php","lineNumber":156,"sourceCode":"            }\n\n            if ($this->isBucketInCurrentRegion($s3Client, $name)) {\n                $buckets[] = $name;\n            }\n        }\n\n        return $buckets;\n    }\n\n    /**\n     * Get existing bucket or create a new one following JS SDK logic\n     */\n    private function getOrCreateBucket(): string\n    {\n        $buckets = $this->getRemotionBuckets();\n\n        if (count($buckets) > 1) {\n            throw new Exception(\n                sprintf(\n                    \"You have multiple buckets (%s) in your S3 region (%s) starting with \\\"remotionlambda-\\\". \" .\n                    \"Please see https://remotion.dev/docs/lambda/multiple-buckets.\",\n                    implode(', ', $buckets),\n                    $this->region\n                )\n            );\n        }\n\n        if (count($buckets) === 1) {\n            return $buckets[0];\n        }\n\n        $bucket = $this->makeBucketName();\n        $s3Client = $this->createS3Client();\n\n        try {\n            $params = ['Bucket' => $bucket];","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-php/src/PHPClient.php#L138-L174","documentation":"Thrown by PHPClient::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 pick one safely, so it aborts with a pointer to the docs. This is the PHP equivalent of the Go 1188 error.","triggerScenarios":"getRemotionBuckets() returns 2+ bucket names for $this->region, e.g. after parallel deploys, cross-account deploys into the same region, or manual bucket creation.","commonSituations":"Old bucket from a previous Remotion version lingering alongside a newly deployed one. A teammate created a `remotionlambda-` bucket by hand. Multiple CI accounts deploying into the same region.","solutions":["List the buckets with `aws s3api list-buckets --query 'Buckets[?starts_with(Name,\\`remotionlambda-\\`)].Name'`, keep the one in active use, delete the rest after verifying no needed renders remain.","Follow https://remotion.dev/docs/lambda/multiple-buckets.","Pre-create exactly one bucket and reference it explicitly so future deploys do not create duplicates.","Restrict IAM so only one principal can create `remotionlambda-` buckets in the account."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Preflight in PHP before render.\nprivate function assertSingleBucket(): void {\n    $buckets = $this->getRemotionBuckets();\n    if (count($buckets) > 1) {\n        throw new RuntimeException('Preflight: multiple remotion buckets: ' . implode(', ', $buckets));\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `aws s3api list-buckets` after each deploy to detect duplicates early.","Restrict `remotionlambda-` bucket creation to a single deploy principal.","Reference a specific bucket in config to make creation deterministic."],"tags":["aws","s3","bucket","multi-bucket","config","php","lambda-php"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}