# Having trouble creating Elasticsearch Snapshot Repository

**URL:** <https://discuss.elastic.co/t/having-trouble-creating-elasticsearch-snapshot-repository/311868>\
**Category:** Elasticsearch\
**Tags:** docker, snapshot-and-restore\
**Created:** [August 10, 2022, 6:32pm UTC](https://discuss.elastic.co/t/having-trouble-creating-elasticsearch-snapshot-repository/311868 "2022-08-10T18:32:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![yashverma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yashverma/32/109501_2.png) [@yashverma](https://discuss.elastic.co/u/yashverma)\
**Post date:** [August 10, 2022, 6:32pm UTC](https://discuss.elastic.co/t/having-trouble-creating-elasticsearch-snapshot-repository/311868/1 "2022-08-10T18:32:58Z")

</div>

I want to create snapshot repository in order to backup elasticsearch indices locally. However I am getting error messages, I think I am not giving correct path in location. I have posted screenshots for better explanation.

 ![Screenshot 2022-08-10 at 10.09.38 PM](https://us1.discourse-cdn.com/elastic/original/3X/d/5/d51f9fbeeceaf5847951d533492b591ef605a89d.jpeg)  
This is my docker-compose yaml file  
 ![Screenshot 2022-08-10 at 10.13.55 PM](https://us1.discourse-cdn.com/elastic/original/3X/4/5/45f805d19efe5074aa87e037560095aca0b0fd8c.jpeg)  
and this is elasticsearch configuration file. I get the following error  
 ![Screenshot 2022-08-10 at 10.13.05 PM](https://us1.discourse-cdn.com/elastic/original/3X/3/0/30444ad7ed23f6b7e9c9f5c67c647beeb47c501c.png)  
I am following this [link](https://linuxhint.com/restore-elasticsearch-clusters-snapshots/) for setting up my repository. Any suggestion would be of great help.  
I am a bit new to elasticsearch so pardon my ignorance

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 10, 2022, 9:38pm UTC](https://discuss.elastic.co/t/having-trouble-creating-elasticsearch-snapshot-repository/311868/2 "2022-08-10T21:38:20Z")

</div>

Welcome to our community! 😃

Please don't post pictures of text, logs or code. They are difficult to read, impossible to search and replicate (if it's code), and some people may not be even able to see them 🙂

---

<div class="post-metadata">

**Author:** ![Divyank\_Garg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/divyank_garg/32/99581_2.png) [@Divyank\_Garg](https://discuss.elastic.co/u/Divyank_Garg)\
**Post date:** [August 11, 2022, 9:22am UTC](https://discuss.elastic.co/t/having-trouble-creating-elasticsearch-snapshot-repository/311868/3 "2022-08-11T09:22:10Z")

</div>

Hi Warkolm,  
What is the possible way to keep backup of index data and restore it later. I think Yash is trying to use ELK service via docker container.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 12, 2022, 12:36am UTC](https://discuss.elastic.co/t/having-trouble-creating-elasticsearch-snapshot-repository/311868/4 "2022-08-12T00:36:36Z")

</div>

Snapshot and restore is the best.

---

<div class="post-metadata">

**Author:** ![yashverma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yashverma/32/109501_2.png) [@yashverma](https://discuss.elastic.co/u/yashverma)\
**Post date:** [August 12, 2022, 6:10am UTC](https://discuss.elastic.co/t/having-trouble-creating-elasticsearch-snapshot-repository/311868/5 "2022-08-12T06:10:43Z")

</div>

Hi Warkolm,  
We know that is the best solution, can you provide some reference link or some github repos for this snapshot restore solution using docker-compose file because we are getting error in the docker file as mentioned in the screenshot above.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 12, 2022, 6:16am UTC](https://discuss.elastic.co/t/having-trouble-creating-elasticsearch-snapshot-repository/311868/6 "2022-08-12T06:16:02Z")

</div>

As far as I can see the error indicates a syntax error in the configuration for the first volume.

---

<div class="post-metadata">

**Author:** ![Divyank\_Garg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/divyank_garg/32/99581_2.png) [@Divyank\_Garg](https://discuss.elastic.co/u/Divyank_Garg)\
**Post date:** [August 16, 2022, 9:18am UTC](https://discuss.elastic.co/t/having-trouble-creating-elasticsearch-snapshot-repository/311868/7 "2022-08-16T09:18:40Z")

</div>

Hi Christian,  
Are you talking about /mnt/data/collab/backup: /usr/share/elasticsearch/backup ? Here /mnt/data/collab/backup is the directory created by us.

---

<div class="post-metadata">

**Author:** ![yashverma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yashverma/32/109501_2.png) [@yashverma](https://discuss.elastic.co/u/yashverma)\
**Post date:** [August 16, 2022, 9:26am UTC](https://discuss.elastic.co/t/having-trouble-creating-elasticsearch-snapshot-repository/311868/8 "2022-08-16T09:26:40Z")

</div>

Hi Chistian,  
Thank you for pointing that out, I have changed the yaml file and provided the path.repo under environment.  
"  
environment:  
path.repo: /mnt/data/collab/backup\_repo  
"  
While running the docker services it says Access denied, the following is the error message

"  
java.lang.IllegalStateException: Unable to access 'path.repo' (/mnt/data/collab/backup\_repo)  
Likely root cause: java.nio.file.AccessDeniedException: /mnt/data  
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)  
"  
I have already provided root access to the "backup\_repo" folder

drwxrwxrwx 2 root root 4096 Aug 16 00:17 backup\_repo

Can you help to resolve it.

---

<div class="post-metadata">

**Author:** ![cheshirecat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheshirecat/32/109532_2.png) [@cheshirecat](https://discuss.elastic.co/u/cheshirecat)\
**Post date:** [August 16, 2022, 10:57am UTC](https://discuss.elastic.co/t/having-trouble-creating-elasticsearch-snapshot-repository/311868/9 "2022-08-16T10:57:18Z")

</div>

Hello,  
First of all: please use code tag for code/configs.

Secondly: you gave permissions to directory at all nodes? Is at all node path.repo the same path?  
In error stack you got:

```auto
Likely root cause: java.nio.file.AccessDeniedException: /mnt/data

```

Are permissions ok for this directory?  
Could you please do:

```auto
ls -lah /mnt/data

```

?

---

<div class="post-metadata">

**Author:** ![Divyank\_Garg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/divyank_garg/32/99581_2.png) [@Divyank\_Garg](https://discuss.elastic.co/u/Divyank_Garg)\
**Post date:** [August 18, 2022, 8:46am UTC](https://discuss.elastic.co/t/having-trouble-creating-elasticsearch-snapshot-repository/311868/10 "2022-08-18T08:46:44Z")

</div>

Hi,  
We are using 1 node of elasticsearch only and given- `path.repo: ["/mnt/data/collab/backup_repo"]` in elasticsearch.yml  
As mentioned the path has read and write access:

> ls -lah /mnt/data/  
> drwxrwxrwx 3 root root 4.0K Jul 19 01:29 .  
> drwxrwxrwx 3 root root 4.0K Jul 19 00:31 ..  
> drwxrwxrwx 14 root root 4.0K Aug 18 01:24 collab

---

<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:** [September 15, 2022, 8:46am UTC](https://discuss.elastic.co/t/having-trouble-creating-elasticsearch-snapshot-repository/311868/11 "2022-09-15T08:46:55Z")

</div>

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