remotion-dev/remotion · error · error
could not list S3 buckets: %w
Error message
could not list S3 buckets: %w
What it means
Thrown by getRemotionBuckets when ListBuckets fails. ListBuckets is the very first S3 call the bucket-resolution logic makes; if the caller cannot list buckets at all, no Remotion bucket can be discovered or created. The wrapped error is usually AccessDenied or a regional endpoint problem.
Source
Thrown at packages/lambda-go/s3.go:97
// isBucketInRegion reports whether the given bucket lives in region.
func isBucketInRegion(svc bucketLocationGetter, bucket string, region string) (bool, error) {
out, err := svc.GetBucketLocation(context.TODO(), &s3.GetBucketLocationInput{Bucket: new(bucket)})
if err != nil {
var awsErr smithy.APIError
if errors.As(err, &awsErr) && awsErr.ErrorCode() == "NoSuchBucket" {
return false, nil
}
return false, fmt.Errorf("could not get location of S3 bucket %q: %w", bucket, err)
}
location := string(out.LocationConstraint)
return location == region || (location == "" && region == regionUsEast1), nil
}
// getRemotionBuckets lists the Remotion buckets that exist in region.
func getRemotionBuckets(svc *s3.Client, region string) ([]string, error) {
out, err := svc.ListBuckets(context.TODO(), &s3.ListBucketsInput{})
if err != nil {
return nil, fmt.Errorf("could not list S3 buckets: %w", err)
}
buckets := []string{}
for _, bucket := range out.Buckets {
name := aws.ToString(bucket.Name)
if !strings.HasPrefix(name, bucketNamePrefix) {
continue
}
isInRegion, err := isBucketInRegion(svc, name, region)
if err != nil {
return nil, err
}
if isInRegion {
buckets = append(buckets, name)
}
}
return buckets, nil
}
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Add `s3:ListAllMyBuckets` to the IAM policy on `*`.
- Verify the region in the AWS config resolves to a valid S3 endpoint.
- From a VPC-only subnet, add an S3 gateway endpoint so ListBuckets can reach the control plane.
- Inspect the wrapped error code to distinguish AccessDenied from network/endpoint issues.
Defensive patterns
Strategy: validation
Try / catch
buckets, err := getRemotionBuckets(svc, region)
if err != nil {
var awsErr smithy.APIError
if errors.As(err, &awsErr) && awsErr.ErrorCode() == "AccessDenied" {
// missing s3:ListAllMyBuckets - widen the policy
}
return nil, err
} Prevention
- Always grant s3:ListAllMyBuckets on `*` in roles that drive Remotion renders.
- From a VPC-only subnet, add an S3 gateway endpoint.
- Use the same role for a dry-run ListBuckets as a preflight check.
When it happens
Trigger: svc.ListBuckets returns an error because the IAM principal lacks s3:ListAllMyBuckets, because the region endpoint is misconfigured, or because of a network failure reaching the S3 control plane.
Common situations: Scoped-down IAM roles in production that only allow specific bucket ARNs and forget the global list permission. Air-gapped or VPC-only networks without an S3 VPC endpoint.
Related errors
- could not get location of S3 bucket %q: %w
- failed to create bucket: %w
- you have multiple buckets (%s) in your S3 region (%s) starti
- failed to upload inputProps to S3: %w
- could not invoke Lambda function %q: %w
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/5cd811ac3048539a.
Report an issue: GitHub.