# While setting path.repo for snapshot facing error

**URL:** <https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338>\
**Category:** Elasticsearch\
**Created:** [September 28, 2018, 12:40pm UTC](https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338 "2018-09-28T12:40:31Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnrabi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnrabi/32/67223_2.png) [@johnrabi](https://discuss.elastic.co/u/johnrabi)\
**Post date:** [September 28, 2018, 12:40pm UTC](https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338/1 "2018-09-28T12:40:31Z")

</div>

Hi Team,

I have given the backup folder like this in elasticsearch.yml but facing error while restart the elasticsearch , can anyone help me to resolve this issue?

path.repo:["/home/ec2-user/es\_backup"]

Caused by: while scanning a simple key  
in 'reader', line 38, column 1:  
path.repo:["/home/ec2-user/es\_ba ...  
^  
could not find expected ':'  
in 'reader', line 39, column 1:  
#  
^

```
at org.yaml.snakeyaml.scanner.ScannerImpl.stalePossibleSimpleKeys(ScannerImpl.java:465)
at org.yaml.snakeyaml.scanner.ScannerImpl.needMoreTokens(ScannerImpl.java:280)
at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:225)
at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:558)
at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:340)
```

---

<div class="post-metadata">

**Author:** ![johnrabi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnrabi/32/67223_2.png) [@johnrabi](https://discuss.elastic.co/u/johnrabi)\
**Post date:** [October 1, 2018, 5:04am UTC](https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338/2 "2018-10-01T05:04:28Z")

</div>

Hi Team,  
any update? anyone can help me to resolve this issue?

Thanks,  
John D

---

<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:** [October 1, 2018, 6:02am UTC](https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338/3 "2018-10-01T06:02:28Z")

</div>

Can you please show us the full configuration file? Please make sure you format it properly using the available UI tools.

---

<div class="post-metadata">

**Author:** ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)\
**Post date:** [October 1, 2018, 6:10am UTC](https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338/4 "2018-10-01T06:10:38Z")

</div>

> [@johnrabi](#):
>
> path.repo:["/home/ec2-user/es\_backup"]

I know white spaces can be significant in elasticsearch.yml, so it might be worth trying to add a white space after the colon - like this:

`path.repo: ["/home/ec2-user/es_backup"]`

and then restart Elasticsearch.

---

<div class="post-metadata">

**Author:** ![johnrabi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnrabi/32/67223_2.png) [@johnrabi](https://discuss.elastic.co/u/johnrabi)\
**Post date:** [October 4, 2018, 6:29am UTC](https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338/5 "2018-10-04T06:29:48Z")

</div>

hi @Christian_Dahlqvist

this is my configuration file its in aws server

still facing error? can you helpe me to resolve this issue?

# ======================== Elasticsearch Configuration =========================

# 

# NOTE: Elasticsearch comes with reasonable defaults for most settings.

# Before you set out to tweak and tune the configuration, make sure you

# understand what are you trying to accomplish and the consequences.

# 

# The primary way of configuring a node is via this file. This template lists

# the most important settings you may want to configure for a production cluster.

# 

# Please consult the documentation for further information on configuration options:

# [https://www.elastic.co/guide/en/elasticsearch/reference/index.html](https://www.elastic.co/guide/en/elasticsearch/reference/index.html)

# 

# ---------------------------------- Cluster -----------------------------------

# 

# Use a descriptive name for your cluster:

# 

cluster.name: production-prod

# 

# ------------------------------------ Node ------------------------------------

# 

# Use a descriptive name for the node:

# 

node.name: ${HOSTNAME}

# 

# Add custom attributes to the node:

# 

#node.attr.rack: r1

# 

# ----------------------------------- Paths ------------------------------------

# 

# Path to directory where to store the data (separate multiple locations by comma):

# 

#path.data: /path/to/data

# 

# Path to log files:

# 

#path.logs: /path/to/logs

# 

path.repo: ["/home/ec2-user/es\_backup"]

# ----------------------------------- Memory -----------------------------------

# 

# Lock the memory on startup:

# 

#bootstrap.memory\_lock: true

# 

# Make sure that the heap size is set to about half the memory available

# on the system and that the owner of the process is allowed to use this

# limit.

# 

# Elasticsearch performs poorly when the system is swapping the memory.

# ---------------------------------- Network -----------------------------------

# 

# Set the bind address to a specific IP (IPv4 or IPv6):

# 

network.host: 172.34.12.101

# 

# Set a custom port for HTTP:

# 

http.port: 10090

# 

# For more information, consult the network module documentation.

# 

# --------------------------------- Discovery ----------------------------------

# 

# Pass an initial list of hosts to perform discovery when new node is started:

# The default list of hosts is ["127.0.0.1", "[::1]"]

# 

discovery.zen.ping.unicast.hosts: ["172.34.12.101","172.34.12.104"]

# 

# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):

# 

discovery.zen.minimum\_master\_nodes: 2

# 

# For more information, consult the zen discovery module documentation.

# 

# ---------------------------------- Gateway -----------------------------------

# 

# Block initial recovery after a full cluster restart until N nodes are started:

# 

gateway.recover\_after\_nodes: 2

# 

# For more information, consult the gateway module documentation.

# 

# ---------------------------------- Various -----------------------------------

# 

# Require explicit names when deleting indices:

# 

#action.destructive\_requires\_name: true

---

<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:** [October 4, 2018, 6:33am UTC](https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338/6 "2018-10-04T06:33:57Z")

</div>

> [@johnrabi](#):
>
> node.name: ${HOSTNAME}

That looks correct to me, but I am wondering if trying to use an environment variable for `node.name` is allowed and that this might be causing problems. Can you change this to a string and see if that has any effect?

---

<div class="post-metadata">

**Author:** ![johnrabi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnrabi/32/67223_2.png) [@johnrabi](https://discuss.elastic.co/u/johnrabi)\
**Post date:** [October 4, 2018, 6:34am UTC](https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338/7 "2018-10-04T06:34:54Z")

</div>

Thanks @Christian_Dahlqvist will change and try that one

---

<div class="post-metadata">

**Author:** ![johnrabi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnrabi/32/67223_2.png) [@johnrabi](https://discuss.elastic.co/u/johnrabi)\
**Post date:** [October 4, 2018, 6:39am UTC](https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338/8 "2018-10-04T06:39:17Z")

</div>

Hi @Christian_Dahlqvist,  
I have changed the node.name in to string  
now its facing exception like this , i need to give any permission to this folder?

Caused by: java.nio.file.AccessDeniedException: /home/ec2-user/es\_backup  
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:1.8.0\_161]

---

<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:** [October 4, 2018, 6:53am UTC](https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338/9 "2018-10-04T06:53:40Z")

</div>

The user Elasticsearch is running as need full permissions on that directory.

---

<div class="post-metadata">

**Author:** ![johnrabi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnrabi/32/67223_2.png) [@johnrabi](https://discuss.elastic.co/u/johnrabi)\
**Post date:** [October 4, 2018, 7:19am UTC](https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338/10 "2018-10-04T07:19:34Z")

</div>

hi @Christian_Dahlqvist,  
I used these commands to solve the problem:but facing error?

chmod 777 /home/ec2-user/es\_backup , but still facing same error?unable to acess the path.repo

drwxrwxrwx 2 ec2-user ec2-user 4096 Oct 4 07:08 es\_backup

-rw-r--r-- 1 root root 9549 Sep 23 2017 README.textile  
-rw-r--r-- 1 root root 11358 Sep 23 2017 LICENSE.txt  
-rw-r--r-- 1 root root 194187 Sep 23 2017 NOTICE.txt  
drwxr-xr-x 2 root root 4096 Sep 23 2017 plugins  
drwxr-xr-x 2 root root 4096 Mar 5 2018 bin  
drwxr-xr-x 2 root root 4096 Mar 5 2018 lib  
drwxr-xr-x 13 root root 4096 Mar 5 2018 modules  
lrwxrwxrwx 1 root root 19 Apr 25 11:09 config -\> /etc/elasticsearch/  
drwxr-xr-x 2 root root 4096 Apr 25 11:10 logs

Exception  
Caused by: java.lang.IllegalStateException: Unable to access 'path.repo' (/home/ec2-user/es\_backup)  
at org.elasticsearch.bootstrap.Security.addPath(Security.java:444) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:326) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:240) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.bootstrap.Security.configure(Security.java:118) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:228) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.2.jar:5.6.2]  
... 6 more  
Caused by: java.nio.file.AccessDeniedException: /home/ec2-user/es\_backup  
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:1.8.0\_161]  
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:1.8.0\_161]  
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:1.8.0\_161]  
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:1.8.0\_161]  
at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0\_161]  
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0\_161]  
at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0\_161]  
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:486) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.bootstrap.Security.addPath(Security.java:442) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:326) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:240) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.bootstrap.Security.configure(Security.java:118) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:228) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.2.jar:5.6.2]

---

<div class="post-metadata">

**Author:** ![johnrabi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnrabi/32/67223_2.png) [@johnrabi](https://discuss.elastic.co/u/johnrabi)\
**Post date:** [October 4, 2018, 7:40am UTC](https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338/11 "2018-10-04T07:40:50Z")

</div>

hi @Christian_Dahlqvist,

can you help me to resolve this issue?

---

<div class="post-metadata">

**Author:** ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)\
**Post date:** [October 4, 2018, 8:34am UTC](https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338/12 "2018-10-04T08:34:16Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> I am wondering if trying to use an environment variable for `node.name` is allowed

It is, I use the same setting - `node.name: ${HOSTNAME}` - on all my nodes 🙂

---

<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:** [November 1, 2018, 8:34am UTC](https://discuss.elastic.co/t/while-setting-path-repo-for-snapshot-facing-error/150338/13 "2018-11-01T08:34:30Z")

</div>

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