Path.repo is empty

I try to create a snapshot and so I try to create repository at first.

But when I try

PUT /_snapshot/es_backup_basic
{
"type": "fs",
"settings": {
"location": "/backup/es_backup_basic"
}
}

I get an error about

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

So it seems that repo.path is not defined...
But the problem is that I have this option in my elasticsearch.yml :

grep path.repo /etc/elasticsearch/elasticsearch.yml
path.repo: /backup/es_backup_basic

The ES server installed on Ubuntu 14.04
And it's ES 1.6 :

dpkg -l| grep elast
ii elasticsearch 1.6.0 all Open Source, Distributed, RESTful Search Engine

Could somebody give a help?

Thank you in advance...

Thanks, PaulZ

Try path.repo: ["/backup/es_backup_basic"].

Thank you, warkolm...

But I've tried already this syntaxe and it does not work as well.

There are another two strange things that I should mention.

  1. when I do
    localhost:9200/_nodes/?pretty
    I could see my ES config, and indeed path.repo is absent in the conf :

"path" : {
"data" : "/var/lib/elasticsearch",
"work" : "/tmp/elasticsearch",
"home" : "/usr/share/elasticsearch",
"conf" : "/etc/elasticsearch",
"logs" : "/var/log/elasticsearch"
}

But the config settings is correct :

   "config" : "/etc/elasticsearch/elasticsearch.yml",

So, why ES does not read path.repo settings?

  1. In Ubuntu there is also /etc/default/elasticsearch file...
    But all of settings in this file are commented, and there aren't settings for path.repo

Ok. Finally I found there was a problem...

In Ubuntu the elasticsearch directory configured directly in init script /etc/init.d/elasticsearch and then laucnhed via DAEMON_OPTS like :

DAEMON_OPTS="-d -p $PID_FILE --default.config=$CONF_FILE --default.path.home=$ES_HOME --default.path.logs=$LOG_DIR --default.path.data=$DATA_DIR --default.path.work=$WORK_DIR --default.path.conf=$CONF_DIR"

So for the moment I could fix the problem adding :

REPO_DIR=/backup/es_backup_basic

and

DAEMON_OPTS="-d -p $PID_FILE --default.config=$CONF_FILE --default.path.home=$ES_HOME --default.path.logs=$LOG_DIR --default.path.data=$DATA_DIR --default.path.work=$WORK_DIR --default.path.conf=$CONF_DIR--default.path.repo=$REPO_DIR "

It solved the problem... even it's not normal for me that ES does not get sense of /etc/elasticsearch/elasticsearch.yml settings.

2 Likes

It would be nice if this can be made part of the documentation.

1 Like

This is already documented here: https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html#_shared_file_system_repository

1 Like

And does it documented that it does not work as I described in my solution for the problem?

@paulz sorry, I think I mis understood the comment from @tarunsapra. I read it as an ask for the path.repo variable to be documented which has already been done. I didn't realise that there was extra information that might need to be added to this. Feel free to submit a PR for the documentation if you think it could benefit form extra information

@colings86 I'm sorry too.
In fact I was a little bit sarcastic in my reply. It's because I have found the solution myself, but nobody explain me why it did not work in a standard way...
I think that there is some problem with my install, but I could not find what is wrong and why path.repo: ["/backup/es_backup_basic"] setting does not work.

The setting about path.repo is already in documentation, I confirm
My hint to set it in options for DAEMON... I do not think it deserves to be in the official doc. It probably just a little hint.

I'm sorry again to be a in my sarcastic mood...

I have the same issue in my setup.I tried your suggestions but it is still not working.
Any idea?

I have same problem:
RepositoryException[[es_backup_basic] location [/backup/es_backup_basic]
doesn't match any of the locations specified by path.repo because this
setting is empty]; ",
"status": 500

But ı am using centos . My /etc/init.d codes:

REPO_DIR="/backup/my_backup"
and
daemon --user $ES_USER --pidfile $pidfile $exec -p $pidfile -d -Des.default.path.home=$ES_HOME -Des.default.path.logs=$LOG_DIR -Des.default.path.data=$DATA_DIR -Des.default.path.conf=$CONF_DIR-Des.default.path.repo=$REPO_DIR "
It is true?
Can you help me please?

Hi,

I tried this solution and it has solved this problem but my new error is:

{
"error": {
"root_cause": [
{
"type": "exception",
"reason": "failed to create blob container"
}
],
"type": "exception",
"reason": "failed to create blob container",
"caused_by": {
"type": "access_denied_exception",
"reason": "/backup/my_backup/tests-Qzn-aEpfTSKsBIgfyVwbtw"
}
},
"status": 500
}

Hi,
I am using centos so I give permission to file. After result is correct.

permission to file:
Open the terminal in the backup file and please write permission commands. for example:

chmod u+w backup
chmod u+r backup
chmod u+x backup etc.

1 Like

HI,
Im also facing same erroe even i have applied the path.repo in my elasticsearch.yml and its showing same error. Anyone help me to come out of it.

Here's how I did it. My situation is a bit different, each node is a KVM machine so at the end the NFS was written by kvm user and I gave it chmod 777 to make this happen.

I added path.repo in each node yml file

/etc/elasticsearch/elasticsearch.yml (Ubuntu 14.04):
path.repo: /home/maziyar/backup/

Restarted each node one by one. Then I mounted the nfs (password-less SSH but doesn't matter)

10.0.0.1:/data/ /home/maziyar/backup/ nfs soft,intr,rsize=8192,wsize=8192,noauto

I used kopf plugin to create a repository then took a snapshot. Worked fine!

ES: Elasticsearch 2.2.1