remotion-dev / remotion

🎥 Make videos programmatically with React
https://remotion.dev
Other
20.31k stars 1.01k forks source link

Issue with PutObjectCommand authorization header region mismatch, expecting 'us-west-2'. #3931

Closed JonnyBurger closed 4 months ago

JonnyBurger commented 4 months ago

From message posted on Discord by 0x_master

I logged the tryLambdaWriteFile, region is correct, bucket is correct, credentials are correct but the PutObjectCommand throw the header issue.

logs:

Failed to write file to Lambda:
WARN    AuthorizationHeaderMalformed: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'us-west-2'

INFO    tryLambdaWriteFile <bucket> <key> us-west-2 {
  endpoint: 'https://s3.us-west-2.amazonaws.com',
  accessKeyId: '<key>',
  secretAccessKey: '<secret>'
}

INFO    getServiceClient us-west-2 s3 {
  endpoint: 'https://s3.us-west-2.amazonaws.com',
  accessKeyId: '<key>',
  secretAccessKey: '<secret>'
}
MasterProgs commented 4 months ago

can be fixed by changing region: customCredentials.region ?? "us-east-1" to region: customCredentials.region ?? region

https://github.com/remotion-dev/remotion/blob/5884df86e5e311d6a39dc053b6fc0f0ffb81901a/packages/lambda/src/shared/aws-clients.ts#L212