{"record":{"id":"61a08f02822cecc3","repo":"remotion-dev/remotion","slug":"could-not-load-aws-config-w-61a08f","errorCode":null,"errorMessage":"could not load AWS config: %w","messagePattern":"could not load AWS config: %w","errorType":"exception","errorClass":"error","httpStatus":null,"severity":"error","filePath":"packages/lambda-go/s3.go","lineNumber":72,"sourceCode":"\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn bucketNamePrefix + strings.ReplaceAll(region, \"-\", \"\") + \"-\" + suffix, nil\n}\n\nfunc inputPropsKey(hash string) string {\n\treturn fmt.Sprintf(\"input-props/%s.json\", hash)\n}\n\n// newS3Client creates an S3 client using the same shared config resolution as\n// the Lambda client in invocations.go.\nfunc newS3Client(region string, forcePathStyle bool) (*s3.Client, error) {\n\tawsConfig, err := config.LoadDefaultConfig(\n\t\tcontext.TODO(),\n\t\tconfig.WithRegion(region),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not load AWS config: %w\", err)\n\t}\n\treturn s3.NewFromConfig(awsConfig, func(options *s3.Options) {\n\t\toptions.UsePathStyle = forcePathStyle\n\t}), nil\n}\n\n// isBucketInRegion reports whether the given bucket lives in region.\nfunc isBucketInRegion(svc bucketLocationGetter, bucket string, region string) (bool, error) {\n\tout, err := svc.GetBucketLocation(context.TODO(), &s3.GetBucketLocationInput{Bucket: new(bucket)})\n\tif err != nil {\n\t\tvar awsErr smithy.APIError\n\t\tif errors.As(err, &awsErr) && awsErr.ErrorCode() == \"NoSuchBucket\" {\n\t\t\treturn false, nil\n\t\t}\n\t\treturn false, fmt.Errorf(\"could not get location of S3 bucket %q: %w\", bucket, err)\n\t}\n\tlocation := string(out.LocationConstraint)\n\treturn location == region || (location == \"\" && region == regionUsEast1), nil","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-go/s3.go#L54-L90","documentation":"Thrown by newS3Client when the AWS SDK v2 cannot resolve credentials and region for the S3 client. Identical root cause to 1180 but on the S3 code path — used when serializing input props that exceed the inline payload size and must be uploaded to S3.","triggerScenarios":"serializeInputProps calls newS3Client for a payload that needs S3 upload, and the AWS SDK config chain (env vars, shared profile, IMDS) yields nothing valid for the given region.","commonSituations":"Same as 1180: missing AWS credentials/region in the runtime environment, expired SSO, CI missing AWS_REGION. Only fires when input props are large enough to require S3 rather than an inline payload.","solutions":["Run `aws configure` or set AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_REGION in the environment.","Ensure config.Region is populated on the render request so the SDK does not rely on ambient region resolution.","If the props are small, confirm whether you actually need S3 upload; if not, this path is bypassed (see needsUpload)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate config before serializeInputProps would need S3.\nfunc canReachS3(ctx context.Context, region string) error {\n    cfg, err := config.LoadDefaultConfig(ctx, config.WithRegion(region))\n    if err != nil { return err }\n    _, err = cfg.Credentials.Retrieve(ctx)\n    return err\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set AWS credentials and region in every runtime environment.","If input props are small, confirm needsUpload would skip the S3 path so this code never runs.","Validate AWS config at startup, not at first upload."],"tags":["aws","credentials","config","s3","go","lambda-go"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}