# Creating repository and snapshot in Windows

**URL:** <https://discuss.elastic.co/t/creating-repository-and-snapshot-in-windows/162187>\
**Category:** Elasticsearch\
**Created:** [December 27, 2018, 12:57am UTC](https://discuss.elastic.co/t/creating-repository-and-snapshot-in-windows/162187 "2018-12-27T00:57:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![c95mbq](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@c95mbq](https://discuss.elastic.co/u/c95mbq)\
**Post date:** [December 27, 2018, 12:57am UTC](https://discuss.elastic.co/t/creating-repository-and-snapshot-in-windows/162187/1 "2018-12-27T00:57:40Z")

</div>

Hi,

Almost embarrassed to ask this but how on earth do I create a repository and take a snapshot for a single node running on windows? I thought I had previously done this but my notes are obviously wrong as what I thought was previously working no longer is.

Running a fresh install of v 6.5.4 with absolutely nothing in it.

elasticsearch.yml has a path.repo entry added as

`path.repo: ["\\\\R5874\\elkrepo"]`

on R5874 I've created a windows share called elkrepo and even given "anyone" full control just to try it out. This is also accessible when I open up \R5874\elkrepo

I next restart elasticsearch (I should add that I've changed the port to 9700)

I then uses postman to see if there are any repositories that already exist (though shouldn't be as fresh install)

`GET http://R5874:9700/_snapshot/_all?pretty`

That returns {}

I next do

PUT [http://R5874:9700/\_snapshot/elk\_backup](http://R5874:9700/_snapshot/elk_backup)  
{  
"type": "fs",  
"settings": {  
"compress" : true,  
"location": "\R5874\elkrepo"  
}  
}

that returns

```
{
    "acknowledged": true,
    "shards_acknowledged": true,
    "index": "}"
}

```

However, if I then do

`POST http://R5874:9700/_snapshot/elk_backup/snapshot_1?wait_for_completion=true`

I receive the below response

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

```

Again, I thought I was having heaps of problems when first trying this out several months ago but had it finally working and hence why I took notes but either I noted down the wrong info or I'm delusional and it was never working.

Any help with this would be much appreciated and saving what little hair I have left.

---

<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:** [December 27, 2018, 8:58am UTC](https://discuss.elastic.co/t/creating-repository-and-snapshot-in-windows/162187/2 "2018-12-27T08:58:35Z")

</div>

> [@c95mbq](#):
>
> ```auto
> {
> "acknowledged": true,
> "shards_acknowledged": true,
> "index": "}"
> }
> 
> ```

This is a strange response to receive from a repository creation. `"index": "}"`??

After creating the repository, `GET /_snapshot/_all` should show it. If it doesn't, the repository creation didn't succeed.

---

<div class="post-metadata">

**Author:** ![c95mbq](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@c95mbq](https://discuss.elastic.co/u/c95mbq)\
**Post date:** [December 27, 2018, 8:30pm UTC](https://discuss.elastic.co/t/creating-repository-and-snapshot-in-windows/162187/3 "2018-12-27T20:30:33Z")

</div>

Thanks for your reply David, much appreciated.

I agree that the creation didn't succeed but am stumped as to why that is. I can't find any information in the logs either that would suggest why that is or perhaps I'm just not looking in the right place or for the right thing/s.

That UNC path looks ok for the path.repo entry doesn't it (windows)? I've asked a colleague to try read/write access to the share and they are able to read/write from/to that location without any problems.

Any suggestions on how to resolve this would be much appreciated.

Thank you for your kind help

---

<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:** [December 27, 2018, 8:44pm UTC](https://discuss.elastic.co/t/creating-repository-and-snapshot-in-windows/162187/4 "2018-12-27T20:44:48Z")

</div>

I would expect a UNC path to start with a double-backslash, but it's possible that was lost when you copied it here. How are you submitting these requests? Perhaps the backslashes themselves need quoting, since this is JSON in which a backslash is an escape character?

```auto
PUT http://R5874:9700/_snapshot/elk_backup
{
  "type": "fs",
  "settings": {
    "compress" : true,
    "location": "\\\\R5874\\elkrepo"
  }
}

```

---

<div class="post-metadata">

**Author:** ![c95mbq](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@c95mbq](https://discuss.elastic.co/u/c95mbq)\
**Post date:** [December 28, 2018, 3:51am UTC](https://discuss.elastic.co/t/creating-repository-and-snapshot-in-windows/162187/5 "2018-12-28T03:51:03Z")

</div>

Thanks for your help David, much appreciated.

Sorry, I had some bad info in that previous post. What I posted was a Hail Mary attempt but I can confirm that my original put request was/is as posted by yourself.

What seems odd though is that if I make that post request (using postman) I receive the below:  
{  
"acknowledged": true,  
"shards\_acknowledged": true,  
"index": "}"  
}

If I then repeat that same put request I receive the below:

```
{
    "error": {
        "root_cause": [
            {
                "type": "resource_already_exists_exception",
                "reason": "index [}/MKClJXxWR-2Z1fXNaQoMyQ] already exists",
                "index_uuid": "MKClJXxWR-2Z1fXNaQoMyQ",
                "index": "}"
            }
        ],
        "type": "resource_already_exists_exception",
        "reason": "index [}/MKClJXxWR-2Z1fXNaQoMyQ] already exists",
        "index_uuid": "MKClJXxWR-2Z1fXNaQoMyQ",
        "index": "}"
    },
    "status": 400
}

```

yet if I then make a get request for /\_snapshot/\_all? I receive {} as response

Thank you for your kind help

---

<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:** [December 28, 2018, 7:57am UTC](https://discuss.elastic.co/t/creating-repository-and-snapshot-in-windows/162187/6 "2018-12-28T07:57:50Z")

</div>

It looks like your request is being interpreted as a request to create an index called `}`. I think that means the request that's getting to Elasticsearch is not what you think it is, and amongst other things for some reason there is a `}` in the URL.

---

<div class="post-metadata">

**Author:** ![c95mbq](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@c95mbq](https://discuss.elastic.co/u/c95mbq)\
**Post date:** [January 1, 2019, 8:43pm UTC](https://discuss.elastic.co/t/creating-repository-and-snapshot-in-windows/162187/7 "2019-01-01T20:43:32Z")

</div>

Thanks David, and Happy New Year!

Ok so looks like I don't know what I'm doing and the problem was with how I issued those requests in postman as it works fine doing the same within Kibana.

Thanks for all your help David, much appreciated

---

<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:** [January 1, 2019, 10:30pm UTC](https://discuss.elastic.co/t/creating-repository-and-snapshot-in-windows/162187/8 "2019-01-01T22:30:29Z")

</div>

No problem, glad you worked it out.

---

<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:** [January 29, 2019, 10:30pm UTC](https://discuss.elastic.co/t/creating-repository-and-snapshot-in-windows/162187/9 "2019-01-29T22:30:32Z")

</div>

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