s5cmd icon indicating copy to clipboard operation
s5cmd copied to clipboard

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

Open durka opened this issue 11 months ago • 0 comments

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.

durka avatar Mar 04 '24 23:03 durka