Creating repository and snapshot in Windows

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
{
"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.

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.

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

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?

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

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

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.

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

1 Like

No problem, glad you worked it out.

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