When i tried to create a repository by using kibana it is throwing an error like this

command i used to create the repository

PUT /_snapshot/my_backup
{

"type": "fs", 

"settings": {

    "location": "repo/my_backup", 

    "compress": true

}

}

exception : {
"error": {
"root_cause": [
{
"type": "repository_exception",
"reason": "[my_backup] failed to create repository"
}
],
"type": "repository_exception",
"reason": "[my_backup] failed to create repository",
"caused_by": {
"type": "creation_exception",
"reason": "Guice creation errors:\r\n\r\n1) Error injecting constructor, RepositoryException[[my_backup] location [repo/my_backup] doesn't match any of the locations specified by path.repo because this setting is empty]\r\n at org.elasticsearch.repositories.fs.FsRepository.(Unknown Source)\r\n while locating org.elasticsearch.repositories.fs.FsRepository\r\n while locating org.elasticsearch.repositories.Repository\r\n\r\n1 error",
"caused_by": {
"type": "repository_exception",
"reason": "[my_backup] location [repo/my_backup] doesn't match any of the locations specified by path.repo because this setting is empty"
}
}
},
"status": 500
}

Hi Sukesh,

You'll need to whitelist the repo path first in your elasticsearch.yml before you can add a repo with that path.

Best regards,

@Joshua_Rich

Hi Joshua,

i tried to whitelist the repo path in elasticsearch.yml with

#path.repo: /path/to/repo

in paths section but same error is throwing agian.

What you've shown there is still commented? Did you remove the # at the start of the line? You'll also need to restart Elasticsearch, config file changes are not live. I also don't think you can use a relative path there, I would suggest using the full path.

No it was not commented ,I used path.repo: [D:/elasticsearch-2.3.1/repo/my_backup] without # tag , i used full path of the file ,and i restarted the ES , i tried with the
PUT /_snapshot/my_backup
{

"type": "fs",

"settings": {

"location": "repo/my_backup", 

"compress": true

}
}
and changed the path like

PUT /_snapshot/my_backup
{

"type": "fs",

"settings": {

"location": "D:\\elasticsearch-2.3.1\\repo\\my_backup", 

"compress": true

}
}

still having the same exception .

The original exception you posted is because you already have a repo "my_backup" registered that literally has the path repo/my_backup. Try deleting that repo and try again with the new settings.

i tried to delete the my_backup in kibana using

DELETE /_snapshot/my_backup
{

  "type": "fs",

  "settings": {

"location": "D:\\elasticsearch-2.3.1\\repo\\my_backup"
  }

}

but throwing exception like

exception : {
"error": {
"root_cause": [
{
"type": "repository_missing_exception",
"reason": "[my_backup] missing"
}
],
"type": "repository_missing_exception",
"reason": "[my_backup] missing"
},
"status": 404
}