Issue in endpoint region, it is not using the region configured

Created on 13 March 2025, 21 days ago

Problem/Motivation

Installed the module s3fs to my project in D10 (multisite), I configured the module with the access key, secret key and bucket name, the region is blocked and it is showing eu-south-2 after saving the configuration.
I forced the region configuration to us-east-2 using drush, and this value is displayed in the configuration form... however when I try to upload a file to S3 the next error is displayed

An error occurred when uploading a file: Error executing "PutObject" on "https://teacher.-bucket.s3.eu-south-2.amazonaws.com/s3fs-private/2025-03..."; AWS HTTP error: Client error: `PUT https://teacher.-bucket.s3.eu-south-2.amazonaws.com/s3fs-private/2025-03...` resulted in a `400 Bad Request` response: <?xml version="1.0" encoding="UTF-8"?> IllegalLocationConstraintExceptionThe us-east-2 loca (truncated...) IllegalLocationConstraintException (client): The us-east-2 location constraint is incompatible for the region specific endpoint this request was sent to. - <?xml version="1.0" encoding="UTF-8"?> IllegalLocationConstraintExceptionThe us-east-2 location constraint is incompatible for the region specific endpoint this request was sent to.62P3REKQ0CGFBYV89nQ+/9k7K1TnQ/TNGkBBuMf3YjKsLtF2fcDOtHs/Fr5k/8tgehAFvLzAmBLni94hko6FUz+ExuCjgdZwlTFtDXwowJqTKhHV. Request ID: 62P3REKQ0CGFBYV8

I don't know why the enpodint is pointing to eu-south-2

πŸ› Bug report
Status

Active

Version

3.7

Component

Code

Created by

πŸ‡¨πŸ‡΄Colombia ja_avila

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ja_avila
  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    Note: I am assuming you are not using a custom host, if so that should be removed first.

    the region is blocked and it is showing eu-south-2 after saving the configuration.

    We obtain this from AWS. AWS believes the bucket is in eu-south-2, if this is incorrect than AWS internally is going to have a significant problem.

    teacher.-bucket
    Is this the actual bucket name? IIRC a hyphen is not permitted at the start of a hostname portion, was this suppose to be teacher-bucket or is this an older path based only bucket?

    I don't know why the enpodint is pointing to eu-south-2

    I've seen AWS redirect across regions. I suspect we are connecting to us-east-2 and AWS is redirecting us to eu-south-2 (as that is where they believe the bucket is located) where the region field (set in the API locally) now indicates a mismatch and AWS rejects the request.

    Other possible thoughts: is this a multi-region access point or an accelerated access point?

  • πŸ‡¨πŸ‡΄Colombia ja_avila

    The bucket was created in us-east-2 region, however, for any reason, the region saved in the sf3fs config form is eu-south-2.

  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    for any reason, the region saved in the sf3fs config form is eu-south-2.

    https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html
    As noted in #2 We use the AWS API to obtain the location. That value comes directly from Amazon Web Services.

    Still awaiting answer to the other questions from #2 to attempt to move this forward.

  • πŸ‡¨πŸ‡΄Colombia ja_avila

    Other possible thoughts: is this a multi-region access point or an accelerated access point?
    I ran the command
    aws s3control list-multi-region-access-points --account-id XXXXXXX

    And it shows:
    An error occurred (PermanentRedirect) when calling the ListMultiRegionAccessPoints operation: This API operation is only available in the following Regions: us-west-2. Make sure to send all future requests to a supported Region.

  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    I am unclear on what you are trying to say in #5. All that was posted was an error message indicating an AWS Client configuration error.

    teacher.-bucket</bucket> I've checked with AWS and they confirm <code>Bucket name must not contain dash next to period. This appears to be the first error based on the details provided.

Production build 0.71.5 2024