Skip to content

S3 list-directory-buckets fails with Could not connect to the endpoint URL when used in unsupported regions #4684

@oleksii-k-amzn

Description

@oleksii-k-amzn

Describe the bug

When used in unsupported regions for S3 Express One (for example eu-central-1) Boto3 fails with

File "/opt/amazon/lib/python3.10/site-packages/botocore/httpsession.py", line 494, in send
    raise EndpointConnectionError(endpoint_url=request.url, error=e)
botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "https://s3express-control.eu-central-1.amazonaws.com/

instead of telling to the customer that the region is not supported for this API

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Instead of timeout exception there should be some other exception thrown that would inform the user about endpoint availability.

Current Behavior

Timeout exception is thrown when used with the region that does not support S3 Express One

File "/opt/amazon/lib/python3.10/site-packages/botocore/httpsession.py", line 494, in send
    raise EndpointConnectionError(endpoint_url=request.url, error=e)
botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "https://s3express-control.eu-central-1.amazonaws.com/

Reproduction Steps

Use Boto3 to call S3.Client.list_directory_buckets(...) in eu-central-1

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/list_directory_buckets.html

Possible Solution

Add S3 Express One regions check and throw proper error

Additional Information/Context

No response

SDK version used

1.42.3

Environment details (OS name and version, etc.)

Running within docker container that uses 137112412989.dkr.ecr.us-west-2.amazonaws.com/amazonlinux@sha256:609328a448f9b1e198785bc2574f4b047d9a3b9542bb5a31fcfaeb9903756201 . Container is running within MDE(ECS)

Metadata

Metadata

Assignees

Labels

feature-requestThis issue requests a feature.p3This is a minor priority issues3service-apiThis issue is caused by the service API, not the SDK implementation.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions