# Cannot create repository for snapshot

**URL:** <https://discuss.elastic.co/t/cannot-create-repository-for-snapshot/77018>\
**Category:** Elasticsearch\
**Created:** [March 1, 2017, 4:13pm UTC](https://discuss.elastic.co/t/cannot-create-repository-for-snapshot/77018 "2017-03-01T16:13:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![madleeen](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@madleeen](https://discuss.elastic.co/u/madleeen)\
**Post date:** [March 1, 2017, 4:13pm UTC](https://discuss.elastic.co/t/cannot-create-repository-for-snapshot/77018/1 "2017-03-01T16:13:01Z")

</div>

Hello,  
I am trying to migrate data from ES version: 2.3.4, Build: e455fd0/2016-06-30T11:24:31Z, JVM: 1.8.0\_91 to newer ES 5x.  
I want to create snasphot a restore it in new ES, but I have problem with creating repository.  
I use docker container and I am trying to do the backup from inside the container:  
curl -XPUT '[http://IP:9200/\_snapshot/my\_backup](http://IP:9200/_snapshot/my_backup)' -d '{  
"type": "fs",  
"settings": {  
"location": "/usr/share/elasticsearch/data/backup/my\_backup",  
"compress": true  
}  
}'  
First thing is that when I use localhost instead of IP, I get: "curl: (7) Failed to connect to localhost port 9200: Connection refused", but it works with IP address.

In container, the path exists with full permission (for sure now):  
root@9ee4cd3b0527:/usr/share/elasticsearch/data/backup# ls -la  
drwxrwxrwx 2 elasticsearch elasticsearch 4096 Mar 1 14:23 my\_backup

I have set path.repo in /etc/elasticsearch/elasticsearch.yml

path.repo: ["/usr/share/elasticsearch/data/backup"]

which is also only parameter set there.  
I have restart whole docker container, and nothing. When I do [http://IP:9200/\_nodes/?pretty](http://IP:9200/_nodes/?pretty), there are only logs and home paths:  
"path" : {  
"logs" : "/usr/share/elasticsearch/logs",  
"home" : "/usr/share/elasticsearch"  
},

When I run the CURL command, I get:

{"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:\n\n1) Error injecting constructor, RepositoryException[[my\_backup] location [/usr/share/elasticsearch/data/backup/my\_backup] 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","caused\_by":{"type":"repository\_exception","reason":"[my\_backup] location [/usr/share/elasticsearch/data/backup/my\_backup] doesn't match any of the locations specified by path.repo because this setting is empty"}}},"status":500}

I run all commands from inside of container. It is standard container elasticsearch:2  
Thank you for you help. I am new to ES and I am lost, even thought I found some similar issues and tried some things (adding REPO\_PATH to init script as described [here](https://discuss.elastic.co/t/path-repo-is-empty/25166/3), changing syntax of path.repo ....)

Thanks.

---

<div class="post-metadata">

**Author:** ![madleeen](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@madleeen](https://discuss.elastic.co/u/madleeen)\
**Post date:** [March 2, 2017, 1:07pm UTC](https://discuss.elastic.co/t/cannot-create-repository-for-snapshot/77018/2 "2017-03-02T13:07:03Z")

</div>

Ok, so I can reply to myself.  
I was adding path.repo property into /etc/elasticsearch.yml, but it didn't work. Then I found there is also elasticsearch.yml in /usr/share/elasticsearch/config. I put it there and it works. I don't know why the configuration file is on two locations there.

---

<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:** [March 30, 2017, 1:07pm UTC](https://discuss.elastic.co/t/cannot-create-repository-for-snapshot/77018/3 "2017-03-30T13:07:14Z")

</div>

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