# S3 repository empty

**URL:** <https://discuss.elastic.co/t/s3-repository-empty/56148>\
**Category:** Elasticsearch\
**Created:** [July 22, 2016, 6:30am UTC](https://discuss.elastic.co/t/s3-repository-empty/56148 "2016-07-22T06:30:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivkumar](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@shivkumar](https://discuss.elastic.co/u/shivkumar)\
**Post date:** [July 22, 2016, 6:30am UTC](https://discuss.elastic.co/t/s3-repository-empty/56148/1 "2016-07-22T06:30:42Z")

</div>

Hello,

I am using cloud-aws plugin. I want to create a S3 repository , I have added the following lines in my elasticsearch.yml:

```
cluster.name : xx
node.name : xx
node.master: false
node.data: true
network.host: _ec2_
cloud.aws.access_key: xx
cloud.aws.secret_key: xx
discovery.type: ec2
plugin.mandatory: cloud-aws
repositories.s3.bucket: my-backup
repositories.s3.region: us-west-2

```

With the above configuration I am able to setup my cluster, but when I query my data node for S3 Repository it gives me empty.

I am using the following command

`http://1.2.3.4:9200/_snapshot/_all`

output : `{}`

Is it necessary to fire the following command first time in order to register/create a repository:

```
PUT _snapshot/my_s3_repository
{
  "type": "s3",
  "settings": {
    "bucket": "my_bucket_name",
    "region": "us-west"
  }
}

```

My access key and secret key has full access for S3.

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:** [July 22, 2016, 7:12am UTC](https://discuss.elastic.co/t/s3-repository-empty/56148/2 "2016-07-22T07:12:26Z")

</div>

Yes You have to PUT a repository as you did.

Is there a problem here?

---

<div class="post-metadata">

**Author:** ![shivkumar](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@shivkumar](https://discuss.elastic.co/u/shivkumar)\
**Post date:** [July 22, 2016, 7:30am UTC](https://discuss.elastic.co/t/s3-repository-empty/56148/3 "2016-07-22T07:30:25Z")

</div>

Thanks dadoonet

I am executing the following command through my browser.

```auto
public_ip:9200/_snapshot/my
{"type":"s3","settings":{"bucket":"my-backup","region":"us-west-2"}}

```

I am facing the following error:

```
{
error: {
root_cause: [
{
type: "repository_missing_exception",
reason: "[my{"type":"s3"] missing"
}
],
type: "repository_missing_exception",
reason: "[my{"type":"s3"] missing"
},
status: 404
}

```

What may be the reason for this error.

---

<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:** [July 22, 2016, 8:10am UTC](https://discuss.elastic.co/t/s3-repository-empty/56148/4 "2016-07-22T08:10:04Z")

</div>

The plugin is not loaded? May be you did not restart the nodes?

---

<div class="post-metadata">

**Author:** ![shivkumar](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@shivkumar](https://discuss.elastic.co/u/shivkumar)\
**Post date:** [July 22, 2016, 9:28am UTC](https://discuss.elastic.co/t/s3-repository-empty/56148/5 "2016-07-22T09:28:29Z")

</div>

Sir I restarted all of my nodes .

Still I am facing same error. I hope I am using right command.

Secondly If I modify my command and If I add `/` after "my" as follows:

```
public_ip:9200/_snapshot/my/
{"type":"s3","settings":{"bucket":"my-backup","region":"us-west-2"}}

```

I am facing the following error :

```
{
error: {
root_cause: [
{
type: "invalid_snapshot_name_exception",
reason: "[my:{"type":"s3"] Invalid snapshot name [{"type":"s3"], must not contain the following characters [\, /, *, ?, ", <, >, |, , ,]"
}
],
type: "invalid_snapshot_name_exception",
reason: "[my:{"type":"s3"] Invalid snapshot name [{"type":"s3"], must not contain the following characters [\, /, *, ?, ", <, >, |, , ,]"
},
status: 400
}

```

Thank you

---

<div class="post-metadata">

**Author:** ![shivkumar](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@shivkumar](https://discuss.elastic.co/u/shivkumar)\
**Post date:** [July 22, 2016, 9:38am UTC](https://discuss.elastic.co/t/s3-repository-empty/56148/6 "2016-07-22T09:38:11Z")

</div>

Done Sir,

I executed the following command on my node:

```
curl -XPOST "http://10.0.1.132:9200/_snapshot/my_backup" -d'
{
  "type": "s3",
  "settings": {
    "bucket": "my-backup",
    "region": "us-west-2"
  }
}
'

```

Now I can see my repository.

One more question Sir, will the plugin will take snapshots automatically or I will have to fire command each time for taking snapshot and restoring it.

If the plugin does not takes snapshot automatically , is there any other tool or third party software to take snapshot automatically .

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:** [July 22, 2016, 10:03am UTC](https://discuss.elastic.co/t/s3-repository-empty/56148/7 "2016-07-22T10:03:26Z")

</div>

> [@shivkumar](#):
>
> will the plugin will take snapshots automatically or I will have to fire command each time for taking snapshot and restoring it.

No

> [@shivkumar](#):
>
> If the plugin does not takes snapshot automatically , is there any other tool or third party software to take snapshot automatically .

I don't think so. But something like curator could help.  
You could use a crontab to run it every x minutes if you wish.

---

<div class="post-metadata">

**Author:** ![shivkumar](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@shivkumar](https://discuss.elastic.co/u/shivkumar)\
**Post date:** [July 22, 2016, 10:13am UTC](https://discuss.elastic.co/t/s3-repository-empty/56148/8 "2016-07-22T10:13:24Z")

</div>

Thank you Sir,

---

<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 5, 2017, 10:33pm UTC](https://discuss.elastic.co/t/s3-repository-empty/56148/9 "2017-07-05T22:33:25Z")

</div>


