# Facing failed to create repository thrown exception

**URL:** <https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996>\
**Category:** Elasticsearch\
**Created:** [October 4, 2018, 8:21am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996 "2018-10-04T08:21:07Z")\
**Posts on this page:** 15\
**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:** [October 4, 2018, 8:21am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/1 "2018-10-04T08:21:07Z")

</div>

Hi Team,

can anyone help me to resolve this issue?

i have setting path.repo like this path.repo: ["/usr/share/elasticsearch/esbackup"] , It is in aws elasticserver but while creating the repository facing this error

curl command

curl -XPUT '23.45.44.4:10090/\_snapshot/productionjobsindexbackup' -d '{  
"type": "fs",  
"settings": {  
"location": "/usr/share/elasticsearch/esbackup",  
"compress": "true"  
}  
}'

Caused by: org.elasticsearch.repositories.RepositoryException: [productionjobsindexbackup] location [/usr/share/elasticsearch/esbackup] doesn't match any of the locations specified by path.repo because this setting is empty  
at org.elasticsearch.repositories.fs.FsRepository.(FsRepository.java:91) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.repositories.RepositoriesModule.lambda$new$0(RepositoriesModule.java:49) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.repositories.RepositoriesService.createRepository(RepositoriesService.java:383) ~[elasticsearch-5.6.2.jar:5.6.2]  
at org.elasticsearch.repositories.RepositoriesService.registerRepository(RepositoriesService.java:356) ~[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 6, 2018, 7:54am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/2 "2018-10-06T07:54:00Z")

</div>

Hi Team,  
Any update on this issue?can you help me to resolve this issue?

Thanks in advance

---

<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 6, 2018, 7:56am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/3 "2018-10-06T07:56:28Z")

</div>

It seems the setting is not found. Did you restart Elasticsearch after adding `path.repo`?

---

<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 6, 2018, 8:13am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/4 "2018-10-06T08:13:16Z")

</div>

yes @Christian_Dahlqvist , i have restarted the elasticsearch after adding the path.repo .

---

<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 6, 2018, 8:15am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/5 "2018-10-06T08:15:16Z")

</div>

How did you install 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 6, 2018, 8:18am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/6 "2018-10-06T08:18:54Z")

</div>

yes @Christian_Dahlqvist , i have installed elasticsearch using debian package ([https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html#deb](https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html#deb))in aws ec2 server.accessing the elasticsearch using public ip in my local.

---

<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 6, 2018, 8:41am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/7 "2018-10-06T08:41:11Z")

</div>

Can you show your config file? Is it located in the [default](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/deb.html#deb-layout) `/etc/elasticsearch` 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 6, 2018, 9:31am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/8 "2018-10-06T09:31:42Z")

</div>

yes @Christian_Dahlqvist, its located in /etc/elasticsearch/elasticsearch.yml .. in my local Es able to take the snapshot and restore is working fine, in aws server only facing this issue. this is my configuration file for your reference.

# ======================== 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: tech-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: ["/usr/share/elasticsearch/esbackup"]

# ----------------------------------- 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

# 

# 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.30.0.198

# 

# 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.30.0.198","172.30.0.199"]

# 

# 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 6, 2018, 9:42am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/9 "2018-10-06T09:42:30Z")

</div>

> [@johnrabi](#):
>
> 172.30.0.198

Can you please format the config file correctly using the UI tools? It is hard to spot errors as it is currently formatted.

---

<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 6, 2018, 10:25am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/10 "2018-10-06T10:25:25Z")

</div>

yes @Christian_Dahlqvist, can you check now ?

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

# 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: techfetch-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: ["/usr/share/elasticsearch/esbackup"]

# ----------------------------------- 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

# 

# 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.30.0.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.30.0.101","172.30.0.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 6, 2018, 10:27am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/11 "2018-10-06T10:27:18Z")

</div>

That is not any better. Please format the config as code using the `</>` tool.

---

<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 6, 2018, 10:41am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/12 "2018-10-06T10:41:04Z")

</div>

is this ok for you @Christian_Dahlqvist or need to format? can you send me to the website link (\</\>)for formatting tool?

# ======================== 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: techfetch-prod

# 

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

# 

# Use a descriptive name for the node:

# 

node.name: $ {

```
HOSTNAM

```

}

# 

# 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: ["/usr/share/elasticsearch/esbackup"]

# ----------------------------------- 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

# 

# 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.30.0.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.30.0.101","172.30.0.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:** ![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 9, 2018, 6:42am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/13 "2018-10-09T06:42:08Z")

</div>

Hi @Christian_Dahlqvist,

Any update on this issue ?

---

<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 9, 2018, 11:54am UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/14 "2018-10-09T11:54:04Z")

</div>

No, I have not spotted anything that looks wrong, so am not sure what is going on.

---

<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 6, 2018, 12:06pm UTC](https://discuss.elastic.co/t/facing-failed-to-create-repository-thrown-exception/150996/15 "2018-11-06T12:06:30Z")

</div>

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