Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'us-east-1` is not a valid region when creating s3 bucket #16978

Closed
xuzha opened this issue Mar 7, 2016 · 5 comments
Closed

'us-east-1` is not a valid region when creating s3 bucket #16978

xuzha opened this issue Mar 7, 2016 · 5 comments
Labels
>bug :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs good first issue low hanging fruit help wanted adoptme

Comments

@xuzha
Copy link
Contributor

xuzha commented Mar 7, 2016

Elasticsearch version: master

JVM version: 1.8

OS version: OSX

Describe the feature:

When we using us-east-1, s3 plugin will first get the endpoint by using the region, and then use the endpoint to create the client, this is fine.

But when creating the bucket, s3 plugin will will the bucket name to build a CreateBucketRequest (link), us-east-1 is not valid for aws s3 sdk.

Reproduce:

PUT _snapshot/test-1
{
  "type": "s3",
  "settings": {
    "bucket": "test-us-east-1",
    "region": "us-east-1"
  }
}
{
   "error": {
      "root_cause": [
         {
            "type": "repository_exception",
            "reason": "[test-6] failed to create repository"
         }
      ],
      "type": "repository_exception",
      "reason": "[test-6] failed to create repository",
      "caused_by": {
         "type": "creation_exception",
         "reason": "Guice creation errors:\n\n1) Error injecting constructor, com.amazonaws.services.s3.model.AmazonS3Exception: The specified location-constraint is not valid (Service: Amazon S3; Status Code: 400; Error Code: InvalidLocationConstraint; Request ID: 85CFF34E01878232), S3 Extended Request ID: Ob5XZJsy8IH7HaZy/moMNAgvaH3ZIrHN9fxyimecIp+xtMZI8nE/sc2YVIoTuf2SuEXyoiQP1wE=\n  at org.elasticsearch.repositories.s3.S3Repository.<init>(Unknown Source)\n  while locating org.elasticsearch.repositories.s3.S3Repository\n  while locating org.elasticsearch.repositories.Repository\n\n1 error",
         "caused_by": {
            "type": "amazon_s3_exception",
            "reason": "The specified location-constraint is not valid (Service: Amazon S3; Status Code: 400; Error Code: InvalidLocationConstraint; Request ID: 85CFF34E01878232)"
         }
      }
   },
   "status": 500
}

Succeed after removed the region

PUT _snapshot/test-1
{
  "type": "s3",
  "settings": {
    "bucket": "test-us-east-1"
  }
}

Same thing happened if we used us-west | ap-southeast | eu-central...
I think if we could get the endpoint, we should using the valid region name and let user be able to create buckets.

@debarshiraha
Copy link

As per http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUT.html: "If you are creating a bucket on the US East (N. Virginia) region (us-east-1), you do not need to specify the location constraint".

Other regions work fine. I can take this up.

@dadoonet
Copy link
Member

Knowing that we deprecated region in #22848 and removed it in #22853, I think we should close this issue as it won't be fixed.

@clintongormley WDYT?

@rjernst
Copy link
Member

rjernst commented Feb 24, 2017

This issue wasn't even about region really, it was about auto bucket creation (failing because of specifying region). Since auto bucket creation is now gone, we can close.

@rjernst rjernst closed this as completed Feb 24, 2017
@dadoonet
Copy link
Member

Thanks @rjernst

@yandooo
Copy link

yandooo commented Feb 27, 2017

@dadoonet and @rjernst thanks.

@clintongormley clintongormley added :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs and removed :Plugin Repository S3 labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs good first issue low hanging fruit help wanted adoptme
Projects
None yet
Development

No branches or pull requests

6 participants