Open siebrand opened 1 year ago
I am also seeing this when running on an ec2 instance.
Same for me.... In my case I thought it was related to multi region: https://github.com/generalui/s3p/issues/72#issuecomment-1819832733
Thanks for the reporting everyone! Have you tried setting the AWS_REGION environment variable? Alternatively, does your ~/.aws/credentials file for your selected profile have a region =
set?
The AWS SDKv3 works a little differently than v2, so I'm still trying to understand what changes. When I have region =
set in my active profile, it works...
Honestly, I haven’t tried. I will probably work. This report was made because what worked in 3.4.x no longer works in 3.5.x.
The big change with 3.5 was switching from the AWS 2.x SDK to the AWS 3.x SDK. There were some pretty big changes in how the AWS SDK works. However, S3P always left all the authorization entirely up to the SDK. So this change is due to how AWS changed their SDK. None-the-less, I'd like to minimize breaking changes for people, so I'm trying to understand how best to do this in this case.
I'll leave this ticket up for a bit. If anyone has experience with this issue, I'd like to hear about your scenario and if any of the options above solve it.
So what's the verdict then? "Accepted regression" or should a region be resolved "somehow" and passed as the region parameter if no region is present?
I've tested a little more, and I've found that the latest version of s3p will only work if ~/.aws/config
has contents like this:
[default]
region = eu-north-1
I've also tried using an environment variable (AWS_DEFAULT_REGION
), but that didn't work. I'd have expected that to work.
@siebrand I encountered the problem today and simply did export AWS_REGION=us-east-1
and it solved it.
Thanks @deAngelisAlex and @siebrand for verifying those two solutions work.
I'm not sure how best to solve this other than detect the problem and suggest the two solutions you've discovered. I can specify the region when initializing the S3 client, but I'd still need to know what it is. The logical way I'd know is directly from the AWS_REGION or ~/.aws/config file... I could add a parameter as a 3rd way to specify the region... I'm not sure that's all that much better.
Could you detect that no region is set, and make it fail less ugly?
I've left my scripts unchanged, and with the latest version, I get the error "Region is missing".
Command:
This command executes successfully as expected with s3p@3.4.10. With s3p@3.5.2, I get this error immediately:
This error appears to be consistent. I noticed it in my development environment first, where I was attempting to update nvm/npm to the latest version. This blocks me from being able to use the latest version of s3p with AWS SDK v3.