minio / minio-py

MinIO Client SDK for Python
https://docs.min.io/docs/python-client-quickstart-guide.html
Apache License 2.0
851 stars 325 forks source link

aws bucket endpoint "invalid Amazon AWS host " #1404

Closed Levalife closed 8 months ago

Levalife commented 8 months ago

Previously I used this link as Minio endpoint: my-bucket.s3.eu-west-1.amazonaws.com to put other buckets into it. But after an update to 7.2.0, I'm getting

ValueError: invalid Amazon AWS host my-bucket.s3.eu-west-1.amazonaws.com

Can we keep using this link or _AWS_S3_ENDPOINT_REGEX allow only clean aws hosts?

balamurugana commented 8 months ago

Please explain the issue clearly. Also share your code.

Levalife commented 8 months ago

On version 7.1.11 this code works fine:

minio_domain = 'prod-bucket.s3.eu-west-1.amazonaws.com'
client = Minio(
             endpoint=minio_domain,
             access_key=access_key,
             secret_key=secret_key,
             secure=True,
             region='eu-west-1'
         )

On version 7.2.0 I'm getting

 ValueError: invalid Amazon AWS host prod-bucket.s3.eu-west-1.amazonaws.com

I've checked that this commit changes regex for aws endpoint https://github.com/minio/minio-py/commit/402f25e56ade2c85d25057217348e3e5d50eae65 . So I can't use my endpoint with the bucket. Is it not allowed anymore?

balamurugana commented 8 months ago

older version (< 7.2.0) has a bug identifying correct endpoint. This is properly fixed in 7.2.0. You should use s3.eu-west-1.amazonaws.com as a endpoint and use bucket 'prod-bucket' for respective API.