You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The S3Client is failing with the following error when the client is created without the region specified. But where as in S3 sdk V1 it was possible to create the client without region.
Exception in thread "main" software.amazon.awssdk.core.exception.SdkClientException: Unable to load region from any of the providers in the chain software.amazon.awssdk.regions.providers.DefaultAwsRegionProviderChain@2e1d27ba: [software.amazon.awssdk.regions.providers.SystemSettingsRegionProvider@7bb58ca3: Unable to load region from system settings. Region must be specified either via environment variable (AWS_REGION) or system property (aws.region)., software.amazon.awssdk.regions.providers.AwsProfileRegionProvider@4d826d77: No region provided in profile: default, software.amazon.awssdk.regions.providers.InstanceProfileRegionProvider@7e9131d5: Unable to contact EC2 metadata service.]
at software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:98)
at software.amazon.awssdk.regions.providers.AwsRegionProviderChain.getRegion(AwsRegionProviderChain.java:70)
at software.amazon.awssdk.awscore.client.builder.AwsDefaultClientBuilder.regionFromDefaultProvider(AwsDefaultClientBuilder.java:202)
at software.amazon.awssdk.awscore.client.builder.AwsDefaultClientBuilder.resolveRegion(AwsDefaultClientBuilder.java:184)
at software.amazon.awssdk.awscore.client.builder.AwsDefaultClientBuilder.finalizeChildConfiguration(AwsDefaultClientBuilder.java:135)
at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.syncClientConfiguration(SdkDefaultClientBuilder.java:157)
at software.amazon.awssdk.services.s3.DefaultS3ClientBuilder.buildClient(DefaultS3ClientBuilder.java:27)
at software.amazon.awssdk.services.s3.DefaultS3ClientBuilder.buildClient(DefaultS3ClientBuilder.java:22)
at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.build(SdkDefaultClientBuilder.java:129)
Providing region to the the S3Client builder resolves the above error but we get the authorization header malformed error when we perform an operation on the bucket of different region.
Exception in thread "main" software.amazon.awssdk.services.s3.model.S3Exception: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'us-east-2' (Service: S3, Status Code: 400, Request ID: DE3E42A889709617, Extended Request ID: Zw3FvxfFC2ap3+c69b1yJ6zCxdUVffO+gfBYXr5R3wHZKwnENH8soPo7jjLDped718OZkHOA8EY=)
Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
The S3Client is failing with the following error when the client is created without the region specified. But where as in S3 sdk V1 it was possible to create the client without region.
Providing region to the the S3Client builder resolves the above error but we get the authorization header malformed error when we perform an operation on the bucket of different region.
Exception in thread "main" software.amazon.awssdk.services.s3.model.S3Exception: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'us-east-2' (Service: S3, Status Code: 400, Request ID: DE3E42A889709617, Extended Request ID: Zw3FvxfFC2ap3+c69b1yJ6zCxdUVffO+gfBYXr5R3wHZKwnENH8soPo7jjLDped718OZkHOA8EY=)
v1
v2
I am looking for a solution to create the S3Client without region as the customer doesn't provide the bucket region to us.
Your Environment
The text was updated successfully, but these errors were encountered: