# ElasticSearch Snapshot to S3

**URL:** https://discuss.elastic.co/t/elasticsearch-snapshot-to-s3/129658
**Category:** Elasticsearch
**Created:** [April 26, 2018, 12:10pm UTC](https://discuss.elastic.co/t/elasticsearch-snapshot-to-s3/129658 "2018-04-26T12:10:30Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![pratsy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pratsy/32/30685_2.png) [@pratsy](https://discuss.elastic.co/u/pratsy)
#### Post date: [April 26, 2018, 12:10pm UTC](https://discuss.elastic.co/t/elasticsearch-snapshot-to-s3/129658/1 "2018-04-26T12:10:30Z")

</div>

Hello Community,

Not able to register new repository snapshot to S3.

Request

curl -XPUT '[http://localhost:9200/\_snapshot/s3\_repository?verify=false&pretty](http://localhost:9200/_snapshot/s3_repository?verify=false&pretty)' -d'  
{  
"type": "s3",  
"settings": {  
"bucket": "\*\*\*_",  
"region": "ap-south-1",  
"access\_key": "**",  
"secret\_key": "**_"  
}  
}' -H "Content-Type:application/json"

Logs  
{  
"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" : "illegal\_argument\_exception",  
"reason" : "Setting [access\_key] is insecure, but property [allow\_insecure\_settings] is not set"  
}  
},  
"status" : 500  
}

---

<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: [April 26, 2018, 4:48pm UTC](https://discuss.elastic.co/t/elasticsearch-snapshot-to-s3/129658/2 "2018-04-26T16:48:47Z")

</div>

You can't use anymore `access_key` / `secret_key` in the repository settings because anyone can read your credentials then. Which makes that insecure.

If you still want to do it, set `allow_insecure_settings: true` in your `elasticsearch.yml` file.

Better, use secured settings: [https://www.elastic.co/guide/en/elasticsearch/reference/6.2/secure-settings.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/secure-settings.html)

As explained in [https://www.elastic.co/guide/en/elasticsearch/plugins/current/repository-s3-client.html](https://www.elastic.co/guide/en/elasticsearch/plugins/current/repository-s3-client.html)

---

<div class="post-metadata">

### Author: ![pratsy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pratsy/32/30685_2.png) [@pratsy](https://discuss.elastic.co/u/pratsy)
#### Post date: [April 27, 2018, 7:12am UTC](https://discuss.elastic.co/t/elasticsearch-snapshot-to-s3/129658/3 "2018-04-27T07:12:30Z")

</div>

Hi Dadoonet,

I tried adding "allow\_insecure\_settings: true in my elasticsearch.yml file", but after elasticsearch restart I am getting following errors in the logs.

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

---

<div class="post-metadata">

### Author: ![pratsy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pratsy/32/30685_2.png) [@pratsy](https://discuss.elastic.co/u/pratsy)
#### Post date: [April 27, 2018, 7:29am UTC](https://discuss.elastic.co/t/elasticsearch-snapshot-to-s3/129658/4 "2018-04-27T07:29:00Z")

</div>

And when I was setting access.key and secret.key (according to the blog provided ) then having following problem ---\>

Request

```
curl -XPUT 'http://localhost:9200/_snapshot/s3_repository' -d'
> {
> "type": "s3",
> "settings": {
> "bucket": " *****",
> "region": "ap-south-1"
> } 
> }' -H "Content-Type:application/json" 

```

Response

```
{
  "acknowledged" : true
}

```

Request  
`GET /_snapshot/_all`

Response  
`"Empty response"`

hence not able to PUT any repository in the given bucket.

---

<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: [April 27, 2018, 8:44am UTC](https://discuss.elastic.co/t/elasticsearch-snapshot-to-s3/129658/5 "2018-04-27T08:44:32Z")

</div>

Can you share the exact steps you did to add the keys and the repository?  
Please take that from your history. Don't copy/paste the documentation but what you did exactly.

Also, share elasticsearch logs.

---

<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: [May 25, 2018, 8:48am UTC](https://discuss.elastic.co/t/elasticsearch-snapshot-to-s3/129658/6 "2018-05-25T08:48:23Z")

</div>

In case anyone stumbles this thread,

`echo "-Des.allow_insecure_settings=true" >> /usr/share/elasticsearch/config/jvm.options` should fix the issue.
