Backup and Restore issue

(Alexander Sombillo) #1

Hello Guys,

I am having an error in creating a backup for my restore point in Elasticsearch. I keep getting this error:

when I run this command:
curl -XPUT 'localhost:9200/_snapshot/my_backup' -d '

"my_backup": {
    "type": "FS",
    "settings": {
        "location": "my_backup",
        "compress": true


Can anyone comment? Did i execute my cURL statement wrong?

(Jason Tedor) #2

Like this:

$ curl -XPUT localhost:9200/_snapshot/my_backup -d '
  "type": "fs",
  "settings": {
    "location": "/path/to/repository",
    "compress": true

Note that you'll need to have configured path.repo as well. You're missing an opening brace (thus the Failed to derive xcontent in the error message), but even fixing that you have an extra wrapper my_backup: { ... } that you should not have.

(Alexander Sombillo) #3

Hello jasontedor,

Thank you for the Reply, it is now correct I believe for I faced another error. The path.repo. I have set a value of the repository as seen in the screenshot below:

I created this in the elasticsearch.yml file, did I define it correctly? For I keep getting the "path.repo is empty" error as seen below.


(Jason Tedor) #4

You have it commented out with the leading # in your screenshot:

(Alexander Sombillo) #5

Hello jasontedor,

Thanks for the quick reply, I have removed the commented line and placed it at the edge, as seen below. Although the error still persists, any recommendations?

I have changed the location to usr/bin for it was one of the declared mounted directories in my system.

(Jason Tedor) #6

I'm confused, are you on Windows or are you on Linux? Your first attempt seemed to indicate that you're on a Windows system but your second attempt looks to be something different?

You need to set path.repo to a path that exists in the filesystem and the Elasticsearch process has privileges to write to. Then you need to use that path when you use the create snapshot API.

(Alexander Sombillo) #7

Hello jasontedor,

I am using a Windows Platform, the above screenshots shows me using 'Cygwin64'. Cygwin64 or Cygwin emulates a Unix like environment in a Windows Platform. Windows command Line has an issue when I execute curl statements on.

Got it to Work Jason, thanks it was the comment(#) all along. :sweat_smile:


(Jason Tedor) #8

Awesome, glad that we got it sorted out. :slight_smile:

(system) #9