peak / s5cmd

Parallel S3 and local filesystem execution tool.
MIT License
2.71k stars 239 forks source link

Region setting ignored in credentials file (and awscli doesn't need the setting at all) #709

Open durka opened 8 months ago

durka commented 8 months ago

I have two profiles in my credentials file.

The default profile works with buckets in the us-gov-east-1 region. The other profile (call it "east") only has buckets in us-east-1.

With aws s3 ls, this somehow all works automatically and transparently. However, when I try to do s5cmd --profile east ls $bucket, it fails:

ERROR "ls --humanize=true s3://REDACTED": InvalidAccessKeyId: The AWS Access Key Id you provided does not exist in our records. status code: 403, request id: REDACTED, host id: REDACTED=

I added region = us-east-1 to ~/.aws/credentials, but contrary to the README, s5cmd apparently ignores this. Only setting AWS_REGION=us-east-1 in the environment will convince it to use the correct region, and then it is able to list the bucket.