# Official docker image bug - cannot resolve config path

**URL:** <https://discuss.elastic.co/t/official-docker-image-bug-cannot-resolve-config-path/29015>\
**Category:** Elasticsearch\
**Created:** [September 10, 2015, 10:41am UTC](https://discuss.elastic.co/t/official-docker-image-bug-cannot-resolve-config-path/29015 "2015-09-10T10:41:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Skiller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander_skiller/32/4697_2.png) [@Alexander\_Skiller](https://discuss.elastic.co/u/Alexander_Skiller)\
**Post date:** [September 10, 2015, 10:41am UTC](https://discuss.elastic.co/t/official-docker-image-bug-cannot-resolve-config-path/29015/1 "2015-09-10T10:41:35Z")

</div>

I am using official elasticsearch docker image to run my elasticsearch instance.  
I am trying to create an index with some filters which require to load some files (synonym filter, stopword filter...) none of such filters works because I get errors such as this one:

```
{
   "error": "RemoteTransportException[[Hood][inet[/172.17.0.6:9300]][indices:admin/create]]; nested: IndexCreationException[[admin] failed to create index]; nested: FailedToResolveConfigException[Failed to resolve config path [/usr/share/elasticsearch/config/synonyms/sk_SK.txt], tried file path [/usr/share/elasticsearch/config/synonyms/sk_SK.txt], path file [/opt/logstash/config/usr/share/elasticsearch/config/synonyms/sk_SK.txt], and classpath]; ",
   "status": 500
}

```

this is my code to create the index:

```
POST /admin
{
   "settings": {
      "analysis": {
         "filter": {
           "synonym_filter": {
              "type": "synonym",
              "synonyms_path": "/usr/share/elasticsearch/config/synonyms/sk_SK.txt",
              "ignore_case": true
           },
           "sk_SK" : {
              "type" : "hunspell",
              "locale" : "sk_SK",
              "dedup" : true,
              "recursion_level" : 0
            },
            "nGram_filter": {
               "type": "nGram",
               "min_gram": 2,
               "max_gram": 20,
               "token_chars": [
                  "letter",
                  "digit",
                  "punctuation",
                  "symbol"
               ]
            }
         },
         "analyzer": {
            "slovencina_synonym": {
              "type": "custom",
              "tokenizer": "standard",
              "filter": [
                "lowercase",
                "synonym_filter",
                "asciifolding"
                ]
            },
            "slovencina": {
              "type": "custom",
              "tokenizer": "standard",
              "filter": [
                "lowercase",
                "asciifolding"
                ]
            },
            "nGram_analyzer": {
               "type": "custom",
               "tokenizer": "whitespace",
               "filter": [
                  "lowercase",
                  "asciifolding",
                  "nGram_filter"
               ]
            },
            "whitespace_analyzer": {
               "type": "custom",
               "tokenizer": "whitespace",
               "filter": [
                  "lowercase",
                  "asciifolding"
               ]
            }
         }
      }
   }
}

```

The file is there on that path of course inside this docker container.

I was googling the error and I have read some posts that the problem is in file/folder permissions, so I tried the following:

```
sudo chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/config/*
chmod o+x /usr
chmod o+x /usr/share
chmod o+x /usr/share/elasticsearch
chmod o+x /usr/share/elasticsearch/config/

```

still did not work after this.

Since this is happening inside docker container which is using official docker elasticsearch image, I consider this as a bug and this should work out of the box, yet I did not find any solution for this. I would appreciate if anyone could post some workaround.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 10, 2015, 12:17pm UTC](https://discuss.elastic.co/t/official-docker-image-bug-cannot-resolve-config-path/29015/2 "2015-09-10T12:17:12Z")

</div>

> [@Alexander\_Skiller](#):
>
> Since this is happening inside docker container which is using official docker elasticsearch image, I consider this as a bug and this should work out of the box, yet I did not find any solution for this. I would appreciate if anyone could post some workaround.

Just a note about that. This is not official from elastic side as far as I know.  
Looking at the [contributor list](https://github.com/docker-library/elasticsearch/graphs/contributors), no one is working for elastic. And the title for this repo is: "Docker Official Image packaging for elasticsearch".

As I wrote in the issue:

> May be your docker instance does not have access to this file?

```
Failed to resolve config path [/usr/share/elasticsearch/config/synonyms/sk_SK.txt], 
tried file path [/usr/share/elasticsearch/config/synonyms/sk_SK.txt], 
path file [/opt/logstash/config/usr/share/elasticsearch/config/synonyms/sk_SK.txt], 
and classpath

```

Is it something you can test when your docker image is running? Something like: `ls -l /usr/share/elasticsearch/config/synonyms/sk_SK.txt`

---

<div class="post-metadata">

**Author:** ![Alexander\_Skiller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander_skiller/32/4697_2.png) [@Alexander\_Skiller](https://discuss.elastic.co/u/Alexander_Skiller)\
**Post date:** [September 10, 2015, 12:26pm UTC](https://discuss.elastic.co/t/official-docker-image-bug-cannot-resolve-config-path/29015/3 "2015-09-10T12:26:25Z")

</div>

thank you for your reply,

My docker instance seems to have access to that file

```
elasticsearch@8e3d64135f9d:~/config/synonyms$ ls -la
drwxr-xr-x 2 elasticsearch elasticsearch 4096 Sep 10 11:42 .
drwxr-xr-x 9 elasticsearch elasticsearch 4096 Sep 10 11:43 ..
-rw-r--r-- 1 elasticsearch elasticsearch 168636 Sep 9 17:15 sk_SK.txt

```

I can even do `cat /usr/share/elasticsearch/config/synonyms/sk_SK.txt`  
and it will show its contents. Both as elasticsearch user or root.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 10, 2015, 1:01pm UTC](https://discuss.elastic.co/t/official-docker-image-bug-cannot-resolve-config-path/29015/4 "2015-09-10T13:01:11Z")

</div>

Interesting. Any chance you can try the exact same configuration but without Docker?

So we can then understand where we should look at?

---

<div class="post-metadata">

**Author:** ![Alexander\_Skiller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander_skiller/32/4697_2.png) [@Alexander\_Skiller](https://discuss.elastic.co/u/Alexander_Skiller)\
**Post date:** [September 10, 2015, 2:24pm UTC](https://discuss.elastic.co/t/official-docker-image-bug-cannot-resolve-config-path/29015/5 "2015-09-10T14:24:52Z")

</div>

I just tried it in a freshly installed ubuntu server 14.04 inside virtualbox and downloaded and installed java and elasticsearch manually, then I run it, and it works. I am able to create that index. It can successfully load that file from that path. So I suspect the problem is still somewhere on user permission level. I will try to create custom docker image for this, to solve this.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 10, 2015, 3:27pm UTC](https://discuss.elastic.co/t/official-docker-image-bug-cannot-resolve-config-path/29015/6 "2015-09-10T15:27:18Z")

</div>

Thank you for testing!

---

<div class="post-metadata">

**Author:** ![Alexander\_Skiller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander_skiller/32/4697_2.png) [@Alexander\_Skiller](https://discuss.elastic.co/u/Alexander_Skiller)\
**Post date:** [September 10, 2015, 3:49pm UTC](https://discuss.elastic.co/t/official-docker-image-bug-cannot-resolve-config-path/29015/7 "2015-09-10T15:49:38Z")

</div>

So I created my custom docker image from scratch, from pure ubuntu, and tried to set it purely like the virtual machine I have set up. But it did not still work. I was frustrated but I found out that the problem is in **LOGSTASH**

LOGSTASH is running separately as another docker container in my environment and it somehow automatically communicates with ElasticSearch docker image (they are linked). As soon as I killed Logstash container, the query says:

```
{
   "acknowledged": true
}

```

I guess when these two (logstash & ES) are running on the same network and are communicating, ES is expecting some path to exist `/opt/logstash/config/usr/share/elasticsearch/config/synonyms/sk_SK.txt`  
which it doesn't on my ES container.  
/opt/logstash folder does not exist, should it? Why doesn't ES create it automatically if it needs it? I don't understand.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 10, 2015, 4:10pm UTC](https://discuss.elastic.co/t/official-docker-image-bug-cannot-resolve-config-path/29015/8 "2015-09-10T16:10:45Z")

</div>

Most likely you are using logstash with a NodeClient.  
It joins the cluster.

Use logstash with http output.

That should help.

---

<div class="post-metadata">

**Author:** ![Alexander\_Skiller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander_skiller/32/4697_2.png) [@Alexander\_Skiller](https://discuss.elastic.co/u/Alexander_Skiller)\
**Post date:** [September 19, 2015, 4:04pm UTC](https://discuss.elastic.co/t/official-docker-image-bug-cannot-resolve-config-path/29015/9 "2015-09-19T16:04:25Z")

</div>

please could you tell me how do I make logstash stop connecting to elasticsearch? I guess it's elasticsearch feature the autodiscovering of nodes, but I don't know what should be done in order to stop accepting logstah as a node. I want to auto-accept ES nodes that's ok. But no no for logstash

If this helps, this is my config I use to move logs from node.js to ES via logstash

```
input {
  tcp { port => 9292 type=>"sample" }
}

filter {
  json {
    source => "message"
  }
}

output {
  elasticsearch {
    host => "192.168.59.103"
    port => "9200"
    protocol => "http"
  }
  stdout {}
}
```

---

<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:** [July 5, 2017, 11:49pm UTC](https://discuss.elastic.co/t/official-docker-image-bug-cannot-resolve-config-path/29015/10 "2017-07-05T23:49:17Z")

</div>


