# Create snapshot in s3 - issue to create snapshot in region eu-west-2

**URL:** <https://discuss.elastic.co/t/create-snapshot-in-s3-issue-to-create-snapshot-in-region-eu-west-2/149852>\
**Category:** Elasticsearch\
**Created:** [September 25, 2018, 2:26pm UTC](https://discuss.elastic.co/t/create-snapshot-in-s3-issue-to-create-snapshot-in-region-eu-west-2/149852 "2018-09-25T14:26:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronshaiko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ronshaiko/32/35859_2.png) [@Ronshaiko](https://discuss.elastic.co/u/Ronshaiko)\
**Post date:** [September 25, 2018, 2:26pm UTC](https://discuss.elastic.co/t/create-snapshot-in-s3-issue-to-create-snapshot-in-region-eu-west-2/149852/1 "2018-09-25T14:26:01Z")

</div>

Hi guys,

I'm trying to create es snapshots in s3, region: eu-west-2 (London) and facing failure.  
Please see below more info:

es version:

```auto
curl -XGET 'localhost:9200'
{
  "name" : "node-name",
  "cluster_name" : "es-cluster",
  "cluster_uuid" : "IYV8G-gSRmqkQLsSw2OXwQ",
  "version" : {
    "number" : "2.4.6",
    "build_hash" : "5376dca9f70f3abef96a77f4bb22720ace8240fd",
    "build_timestamp" : "2017-07-18T12:17:44Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.4"
  },
  "tagline" : "You Know, for Search"

```

when trying to create snapshot in other region (eu-west-1 for example), it looks good:

```auto
curl -XPUT 'http://localhost:9200/_snapshot/s3_repository?verify=false&pretty' -d'
{
  "type": "s3",
  "settings": {
    "bucket": "bucket-snapshot",
    "region": "eu-west-1"
}
}'

```

response is:

```auto
{
  "acknowledged" : true
}

```

but, when trying the same but in region eu-west-2 - it failed:

```auto
curl -XPUT 'http://localhost:9200/_snapshot/s3_repository?verify=false&pretty' -d'
{
  "type": "s3",
  "settings": {
    "bucket": "bucket-snapshot",
    "region": "eu-west-2"
  }
}'

```

response is:

```auto
{
  "error" : {
    "root_cause" : [ {
      "type" : "repository_exception",
      "reason" : "[s3_repository] failed to create repository"
    } ],
    "type" : "repository_exception",
    "reason" : "[s3_repository] failed to create repository",
    "caused_by" : {
      "type" : "creation_exception",
      "reason" : "Guice creation errors:\n\n1) Error injecting constructor, java.lang.IllegalArgumentException: No automatic endpoint could be derived from region [eu-west-2]\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" : "illegal_argument_exception",
        "reason" : "No automatic endpoint could be derived from region [eu-west-2]"
      }
    }
  },
  "status" : 500
}

```

can you please assist with issue ? what is wrong here ?

Thank you,  
Ron

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [September 25, 2018, 3:35pm UTC](https://discuss.elastic.co/t/create-snapshot-in-s3-issue-to-create-snapshot-in-region-eu-west-2/149852/2 "2018-09-25T15:35:10Z")

</div>

Elasticsearch 2.4 uses AWS SDK version 1.10.69, released no later than April 2016, whereas the AWS `eu-west-2` region was launched in December 2016, so needs a newer SDK.

---

<div class="post-metadata">

**Author:** ![Ronshaiko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ronshaiko/32/35859_2.png) [@Ronshaiko](https://discuss.elastic.co/u/Ronshaiko)\
**Post date:** [September 26, 2018, 11:17am UTC](https://discuss.elastic.co/t/create-snapshot-in-s3-issue-to-create-snapshot-in-region-eu-west-2/149852/3 "2018-09-26T11:17:47Z")

</div>

thank you !

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 26, 2018, 1:00pm UTC](https://discuss.elastic.co/t/create-snapshot-in-s3-issue-to-create-snapshot-in-region-eu-west-2/149852/4 "2018-09-26T13:00:03Z")

</div>

That said, it's probably possible to use the `endpoint` instead of `region`.  
This has been implemented in the plugin to make that possible. See [https://www.elastic.co/guide/en/elasticsearch/plugins/2.4/cloud-aws-repository.html](https://www.elastic.co/guide/en/elasticsearch/plugins/2.4/cloud-aws-repository.html)

So probably this should work although the API version might not be compatible. I mean that you need to test it 😉 :

```auto
curl -XPUT 'http://localhost:9200/_snapshot/s3_repository?verify=false&pretty' -d'
{
  "type": "s3",
  "settings": {
    "bucket": "bucket-snapshot",
    "endpoint": "s3.eu-west-2.amazonaws.com"
  }
}'

```

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [September 26, 2018, 2:50pm UTC](https://discuss.elastic.co/t/create-snapshot-in-s3-issue-to-create-snapshot-in-region-eu-west-2/149852/5 "2018-09-26T14:50:51Z")

</div>

I would be very interested to hear if this does work. I did not suggest setting the `endpoint` because AIUI the [signature algorithm apparently requires the region name](https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html) and I expected that setting the endpoint explicitly would leave the region blank, but I have neither tried it nor traced through the code to verify how it sets the region in this case. If it does work, please let us know!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 24, 2018, 2:51pm UTC](https://discuss.elastic.co/t/create-snapshot-in-s3-issue-to-create-snapshot-in-region-eu-west-2/149852/6 "2018-10-24T14:51:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
