# Create ECS S3 Repository

**URL:** <https://discuss.elastic.co/t/create-ecs-s3-repository/235916>\
**Category:** Elasticsearch\
**Created:** [June 5, 2020, 8:49am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916 "2020-06-05T08:49:59Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [June 5, 2020, 8:49am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/1 "2020-06-05T08:49:59Z")

</div>

Hi Team

I am using below Code to Register S3 ECS Repository with my ES Cluster.

curl -XPUT "localhost:9200/\_snapshot/es\_s3\_repo?pretty" -H 'Content-Type: application/json' -d'  
{  
"type": "s3",  
"settings": {  
"bucket": "es-cmn-bkp-bkt",  
"base\_path": "snapshots",  
"endpoint": "[ECS01S3.mywork.com](http://ECS01S3.mywork.com)",  
"access\_key": "mywork-nonprod-s3",  
"secret\_key": "XXXXXXXXXXXXXXXXXXXXX",  
"protocol": "http"  
}  
}  
'

I am facing below ERROR:

```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "amazon_client_exception",
        "reason" : "amazon_client_exception: Unable to execute HTTP request: es-cmn-bkp-bkt.ECS01S3.mywork.com"
      }
    ],
    "type" : "repository_exception",
    "reason" : "[es_s3_repo] failed to create repository",
    "caused_by" : {
      "type" : "amazon_client_exception",
      "reason" : "amazon_client_exception: Unable to execute HTTP request: es-cmn-bkp-bkt.ECS01S3.mywork.com",
      "caused_by" : {
        "type" : "i_o_exception",
        "reason" : "es-cmn-bkp-bkt.ECS01S3.mywork.com"
      }
    }
  },
  "status" : 500
}

```

We can see that its using bucket.endpoint to access it `"es-cmn-bkp-bkt.ECS01S3.mywork.com"`

Can you please help me to get below link , so that I will be able to connect to S3 bucket properly. `[Endpoint/bucket]`

`ECS01S3.mywork.com/es-cmn-bkp-bkt`

---

<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:** [June 5, 2020, 9:59am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/2 "2020-06-05T09:59:44Z")

</div>

It looks like you are using something other than S3 which expects the ([now-deprecated](https://aws.amazon.com/blogs/aws/amazon-s3-path-deprecation-plan-the-rest-of-the-story/)) path-style access pattern. If so, you should set `path_style_access` to `true` in your [client settings](https://www.elastic.co/guide/en/elasticsearch/plugins/7.7/repository-s3-client.html).

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [June 5, 2020, 10:11am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/3 "2020-06-05T10:11:15Z")

</div>

Hi David

Thanks for reply.

Below are the details of my ES Version 5.6.3 and S3 Plugin Details.

```
{
  "name" : "node-1",
  "cluster_name" : "ES-COMMON",
  "cluster_uuid" : "oatyIujvQUiVTGMTxVvd8A",
  "version" : {
    "number" : "5.6.3",
    "build_hash" : "1a2f265",
    "build_date" : "2017-10-06T20:33:39.012Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.1"
  },
  "tagline" : "You Know, for Search"
}

name component version description
node-1 prometheus-exporter 5.6.3.0 Export ElasticSearch metrics to Prometheus
node-2 prometheus-exporter 5.6.3.0 Export ElasticSearch metrics to Prometheus
node-3 prometheus-exporter 5.6.3.0 Export ElasticSearch metrics to Prometheus
node-4 prometheus-exporter 5.6.3.0 Export ElasticSearch metrics to Prometheus
node-5 prometheus-exporter 5.6.3.0 Export ElasticSearch metrics to Prometheus
node-1 repository-s3 5.6.3 The S3 repository plugin adds S3 repositories
node-2 repository-s3 5.6.3 The S3 repository plugin adds S3 repositories
node-3 repository-s3 5.6.3 The S3 repository plugin adds S3 repositories
node-4 repository-s3 5.6.3 The S3 repository plugin adds S3 repositories
node-5 repository-s3 5.6.3 The S3 repository plugin adds S3 repositories

```

We are using NON-AWS S3 Bucket, i.e ECS S3 Bucket.

As mentioned, I am not able to connect to bucket and register repository.

Hence was thinking and want to try with option "[ECS01S3.mywork.com/es-cmn-bkp-bkt](http://ECS01S3.mywork.com/es-cmn-bkp-bkt)" ...

I will execute with your given suggested settings and update in here.

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [June 5, 2020, 10:27am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/4 "2020-06-05T10:27:59Z")

</div>

Hi David

I suppose this settings is not applicable for ES version 5.6.3.

I am getting below error after setting it in elasticsearch.yml file .

`java.lang.IllegalArgumentException: unknown setting [s3.client.default.path_style_access] please check that any required plugins are installed, or check the breaking changes documentation for removed settings`

---

<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:** [June 5, 2020, 10:49am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/5 "2020-06-05T10:49:48Z")

</div>

Ah, ok, that's quite an old version that's well past the [end of its supported life](https://www.elastic.co/support/eol). I suggest upgrading. I don't know off the top of my head whether you can force path-style access in such an old version.

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [June 6, 2020, 7:09am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/6 "2020-06-06T07:09:14Z")

</div>

Thanks David for your reply.

If we upgrade to ES 7.7 { Latest Version } , will it resolve our error , with our current used Settings in CURL Command ?

Can you please help me in understanding this.

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [June 6, 2020, 8:10am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/7 "2020-06-06T08:10:09Z")

</div>

> [@tusharnemade](#):
>
> We can see that its using bucket.endpoint to access it `"es-cmn-bkp-bkt.ECS01S3.mywork.com"`

Is this behaviour of ES correct ... considering bucketname[.]endpointname ?

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [June 6, 2020, 8:26am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/8 "2020-06-06T08:26:35Z")

</div>

Hi

I dont know how , but my error type got changed ... Now it say UNKNOWN HOST.

```
+ curl -XPUT 'localhost:9200/_snapshot/es_s3_repo?pretty' -H 'Content-Type: application/json' '-d
 {
 "type": "s3",
 "settings": {
 "bucket": "es-cmn-bkp-bkt",
 "base_path": "snapshots",
 "endpoint": "ECS01S3.mywork.com",
 "access_key": "mywork-nonprod-s3",
 "secret_key": "XXXXXXXXXXXXXXXXXXXXX",
 "protocol": "http"
 }
 }
 '
{
  "error" : {
    "root_cause" : [
      {
        "type" : "repository_exception",
        "reason" : "[es_s3_repo] failed to create repository"
      }
    ],
    "type" : "repository_exception",
    "reason" : "[es_s3_repo] failed to create repository",
    "caused_by" : {
      "type" : "amazon_client_exception",
      "reason" : "Unable to execute HTTP request: es-cmn-bkp-bkt.ECS01S3.mywork.com",
      "caused_by" : {
        "type" : "unknown_host_exception",
        "reason" : "es-cmn-bkp-bkt.ECS01S3.mywork.com"
      }
    }
  },
  "status" : 500
}
```

---

<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:** [June 6, 2020, 8:33am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/9 "2020-06-06T08:33:26Z")

</div>

> [@tusharnemade](#):
>
> If we upgrade to ES 7.7 { Latest Version } , will it resolve our error

On reflection, a better fix might be to adjust your ECS storage device to support vhost-style access instead of path-style access. I've no idea if this is even possible, you will need to work with their support to figure that out.

An Elasticsearch upgrade should resolve _this_ error, if you set `path_style_access` to true. Some other adjustments may also be required, check the docs for details. To be clear we do not run any tests against ECS storage devices so there's actually no guarantee it'll work at all. It all depends how faithfully "S3-compatible" your storage device really is.

> [@tusharnemade](#):
>
> Is this behaviour of ES correct ... considering bucketname[.]endpointname ?

Yes, that's correct, this is the so-called "vhost-style access" and is how the real S3 works today. This is explained in the [link I shared above](https://aws.amazon.com/blogs/aws/amazon-s3-path-deprecation-plan-the-rest-of-the-story/) which also tells you that path-style access is deprecated. This means Amazon may remove support for it from a future SDK version, which would cause your repository to stop working. Unfortunately we don't have a lot of control over when that might happen.

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [June 6, 2020, 9:09am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/10 "2020-06-06T09:09:52Z")

</div>

Okay. Thanks David for the update and your response.

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [June 8, 2020, 12:51am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/11 "2020-06-08T00:51:14Z")

</div>

Hi

Anything on this Error Type Error , which could help me ...

> [@tusharnemade](#):
>
> `"type" : "unknown_host_exception"`

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [June 8, 2020, 1:03am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/12 "2020-06-08T01:03:29Z")

</div>

Hi

curl [es-cmn-bkp-bkt.ECS01S3.mywork.com](http://es-cmn-bkp-bkt.ECS01S3.mywork.com)  
curl: (6) Could not resolve host: [es-cmn-bkp-bkt.ECS01S3.mywork.com](http://es-cmn-bkp-bkt.ECS01S3.mywork.com); Name or service not known

My Current Java Version :

```
java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
```

---

<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:** [June 8, 2020, 4:53am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/13 "2020-06-08T04:53:46Z")

</div>

That's not related to elasticsearch I'd say.

`es-cmn-bkp-bkt.ecs01s3.mywork.com` does not exist in any dns records. You need to fix that I believe or use the IP address instead.

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [June 8, 2020, 5:19am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/14 "2020-06-08T05:19:41Z")

</div>

Thanks David for your response.

As earlier you have mentioned its using "vhost-style access" and that the method it should be using it.

I am trying to understand what it the reason its not able to resolve as only `"ecs01s3.mywork.com"` being our endpoint is resolvable from our ES Node successfully. But when bucket name is attached to it for processing by ES , it fails.

Do I need to make this `es-cmn-bkp-bkt.ecs01s3.mywork.com` entry in /etc/hosts or some settings in elasticsearch.yml file.

---

<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:** [June 8, 2020, 6:21am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/15 "2020-06-08T06:21:43Z")

</div>

> [@tusharnemade](#):
>
> I am trying to understand what it the reason its not able to resolve as only `"ecs01s3.mywork.com"` being our endpoint is resolvable from our ES Node successfully.

Because that's how virtual-host-style access works. Please read the [link I've shared above (twice)](https://aws.amazon.com/blogs/aws/amazon-s3-path-deprecation-plan-the-rest-of-the-story/). It explains this.

I don't think we can offer much advice on how to configure your storage device to behave like S3 here. A brief google for "ECS S3 virtual-host access" throws up some links that may be helpful. If that doesn't help, I think you will need to ask for support from the supplier of your storage device.

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [June 8, 2020, 6:39am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/16 "2020-06-08T06:39:44Z")

</div>

Yes , I agreed that you have mentioned about virtual host style access. I have written same in my earlier post.

Thank for all your response and time. It helped to understand the behavior of Path\_style\_access.

I am closing this thread.

---

<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:** [July 6, 2020, 6:39am UTC](https://discuss.elastic.co/t/create-ecs-s3-repository/235916/17 "2020-07-06T06:39:47Z")

</div>

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