# Elasticsearch 5.0.1 docker official image failing to start

**URL:** <https://discuss.elastic.co/t/elasticsearch-5-0-1-docker-official-image-failing-to-start/67000>\
**Category:** Elasticsearch\
**Created:** [November 23, 2016, 3:01pm UTC](https://discuss.elastic.co/t/elasticsearch-5-0-1-docker-official-image-failing-to-start/67000 "2016-11-23T15:01:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![cruizpollino](https://avatars.discourse-cdn.com/v4/letter/c/6a8cbe/32.png) [@cruizpollino](https://discuss.elastic.co/u/cruizpollino)\
**Post date:** [November 23, 2016, 3:01pm UTC](https://discuss.elastic.co/t/elasticsearch-5-0-1-docker-official-image-failing-to-start/67000/1 "2016-11-23T15:01:46Z")

</div>

Good evening,

I'm trying to start elasticsearch 5.0.1 docker official image using following command line:

# docker -D -H unix:///var/run/docker.sock run --cpu-shares 1024 --memory 536870912 -e ES\_JAVA\_OPTS="-Xms2G -Xmx2G" -v /system/mesos/elasticsearchf/:/data/:rw -v /system/mesos/elasticsearchf/config:/config/:rw --net bridge -p 9200:9200/tcp -p 9300:9300/tcp elasticsearch

DEBU[0008] Corrupted prefix: []  
DEBU[0008] [hijack] End of stdout

But if I run following command:

# docker -D -H unix:///var/run/docker.sock run -e ES\_JAVA\_OPTS="-Xms2G -Xmx2G" -v /system/mesos/elasticsearchf/:/data/:rw -v /system/mesos/elasticsearchf/config:/config/:rw --net bridge -p 9200:9200/tcp -p 9300:9300/tcp elasticsearch DEBU[0010] framesize: 80

[2016-11-23T14:51:42,650][INFO][o.e.n.Node] [] initializing ...  
DEBU[0010] framesize: 374  
[2016-11-23T14:51:42,740][INFO][o.e.e.NodeEnvironment] [JH06BUU] using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/mapper/centos-root)]], net usable\_space [33gb], net total\_space [37.4gb], spins? [possibly], types [xfs]  
[2016-11-23T14:51:42,741][INFO][o.e.e.NodeEnvironment] [JH06BUU] heap size [1.9gb], compressed ordinary object pointers [true]  
DEBU[0010] framesize: 140  
[2016-11-23T14:51:42,742][INFO][o.e.n.Node] [JH06BUU] node name [JH06BUU] derived from node ID; set [[node.name](http://node.name)] to override  
DEBU[0010] framesize: 249  
[2016-11-23T14:51:42,744][INFO][o.e.n.Node] [JH06BUU] version[5.0.1], pid[1], build[080bb47/2016-11-11T22:08:49.812Z], OS[Linux/3.10.0-327.36.3.el7.x86\_64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0\_111/25.111-b14]  
DEBU[0011] framesize: 306

it works properly.

Configuration file content

# cat elasticsearch.yml

path:  
data: /data  
logs: /logs  
shared\_data: /data

node.add\_lock\_id\_to\_custom\_path: false  
index.number\_of\_shards:2  
[cluster.name](http://cluster.name): elasticcluster  
discovery.zen.ping.unicast.hosts: ["10.120.1.190", "10.120.1.191"]

Can you help me to understand why is this happening?

Kind Regards

---

<div class="post-metadata">

**Author:** ![dliappis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dliappis/32/56174_2.png) [@dliappis](https://discuss.elastic.co/u/dliappis)\
**Post date:** [November 28, 2016, 6:42am UTC](https://discuss.elastic.co/t/elasticsearch-5-0-1-docker-official-image-failing-to-start/67000/2 "2016-11-28T06:42:46Z")

</div>

Hello,

The issue is that you are not using the Docker image maintained by Elastic (`docker.elastic.co/elasticsearch/elasticsearch:5.0.1`) but rather an Elasticsearch image that is not maintained by Elastic hosted in the Docker Hub Registry.

Please refer to our instructions on how to use the image: [https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docker.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docker.html)

Thank you

---

<div class="post-metadata">

**Author:** ![cruizpollino](https://avatars.discourse-cdn.com/v4/letter/c/6a8cbe/32.png) [@cruizpollino](https://discuss.elastic.co/u/cruizpollino)\
**Post date:** [November 28, 2016, 10:00am UTC](https://discuss.elastic.co/t/elasticsearch-5-0-1-docker-official-image-failing-to-start/67000/3 "2016-11-28T10:00:24Z")

</div>

Good morning Dimitrios,

Thanks for your answer.

I've retested with the recommended image and results are the same.

# docker -D -H unix:///var/run/docker.sock run --cpu-shares 1024 --memory 136870912 -e ES\_JAVA\_OPTS="-Xms2G -Xmx2G" -v /system/mesos/elasticsearchf/:/data/:rw -v /system/mesos/elasticsearchf/config:/config/:rw --net bridge -p 9200:9200/tcp -p 9300:9300/tcp [docker.elastic.co/elasticsearch/elasticsearch:5.0.1](http://docker.elastic.co/elasticsearch/elasticsearch:5.0.1)

DEBU[0004] Corrupted prefix: []  
DEBU[0004] [hijack] End of stdout

# docker -D -H unix:///var/run/docker.sock run -e ES\_JAVA\_OPTS="-Xms2G -Xmx2G" -v /system/mesos/elasticsearchf/:/data/:rw -v /system/mesos/elasticsearchf/config:/config/:rw --net bridge -p 9200:9200/tcp -p 9300:9300/tcp [docker.elastic.co/elasticsearch/elasticsearch:5.0.1](http://docker.elastic.co/elasticsearch/elasticsearch:5.0.1)

DEBU[0009] framesize: 80  
[2016-11-28T09:53:48,931][INFO][o.e.n.Node] [] initializing ...  
DEBU[0009] framesize: 199  
[2016-11-28T09:53:49,545][INFO][o.e.e.NodeEnvironment] [EGDfRUK] using [1] data paths, mounts [[/ (rootfs)]], net usable\_space [9.7gb], net total\_space [9.9gb], spins? [unknown], types [rootfs]  
DEBU[0009] framesize: 132  
[2016-11-28T09:53:49,545][INFO][o.e.e.NodeEnvironment] [EGDfRUK] heap size [1.9gb], compressed ordinary object pointers [true]

Regards

---

<div class="post-metadata">

**Author:** ![dliappis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dliappis/32/56174_2.png) [@dliappis](https://discuss.elastic.co/u/dliappis)\
**Post date:** [November 28, 2016, 10:28am UTC](https://discuss.elastic.co/t/elasticsearch-5-0-1-docker-official-image-failing-to-start/67000/4 "2016-11-28T10:28:30Z")

</div>

Hello,

I am not sure what is the memory limit you are trying to set. The `docker run` [reference](https://docs.docker.com/engine/reference/run/#runtime-constraints-on-resources) mentions the units `b`, `k`, `m`, `g`.

If I run the image using something like

```bash
docker run --rm --cpu-shares 1024 --memory 2G -e ES_JAVA_OPTS="-Xms2G -Xmx2G" -v /usr/share/elasticsearch/data docker.elastic.co/elasticsearch/elasticsearch:5.0.1

```

it works fine here, but setting memory to the value you have `136870912` (130MB?) does not work and anyway would be too little for ES.

Please try instead setting the memory using the Docker recommendations for the units.

Additionally, note that the data dir for the image is `/usr/share/elasticsearch/data` as opposed to `data`; same holds for '/config`, the correct conf dir is`/usr/share/elasticsearch/config`. Please refer to the [official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docker.html) that describes the paths.

Best Regards

---

<div class="post-metadata">

**Author:** ![cruizpollino](https://avatars.discourse-cdn.com/v4/letter/c/6a8cbe/32.png) [@cruizpollino](https://discuss.elastic.co/u/cruizpollino)\
**Post date:** [November 30, 2016, 10:08am UTC](https://discuss.elastic.co/t/elasticsearch-5-0-1-docker-official-image-failing-to-start/67000/5 "2016-11-30T10:08:19Z")

</div>

Good morning Dimitrios,

Thanks for your help on this topic.

I've followed instructions you detailed and followed

```
    https://www.elastic.co/guide/en/elasticsearch/reference/5.0/settings.html

```

in order to configure elasticsearch.yml and log4j2.properties files, those files are located at:

# pwd

```
    /system/mesos/elasticsearchf/config

```

# ls

```
     elasticsearch.yml log4j2.properties

```

Contain of these configuration files:

# cat elasticsearch.yml

path:  
data: /usr/share/elasticsearch/data  
logs: /usr/share/elasticsearch/data  
shared\_data: /usr/share/elasticsearch/data  
config: /usr/share/elasticsearch/config

node.add\_lock\_id\_to\_custom\_path: false  
index.number\_of\_shards: 2  
cluster.name: elasticcluster  
discovery.zen.ping.unicast.hosts: ["10.120.1.190", "10.120.1.191"]

# cat log4j2.properties

appender.rolling.type = RollingFile  
appender.rolling.name = rolling  
appender.rolling.fileName = {sys:es.logs}.log appender.rolling.layout.type = PatternLayout appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %.10000m%n appender.rolling.filePattern = {sys:es.logs}-%d{yyyy-MM-dd}.log  
appender.rolling.policies.type = Policies  
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy  
appender.rolling.policies.time.interval = 1  
appender.rolling.policies.time.modulate = true

And when I run command:

**# docker -D -H unix:///var/run/docker.sock run --cpu-shares 1024 --memory 2634022912 -e ES\_JAVA\_OPTS="-Xms2G -Xmx2G" -v /system/mesos/elasticsearchf/data:/usr/share/elasticsearch/data/:rw -v /system/mesos/elasticsearchf/config:/usr/share/elasticsearch/config/:rw --net bridge -p 9200:9200/tcp -p 9300:9300/tcp [docker.elastic.co/elasticsearch/elasticsearch:5.0.1](http://docker.elastic.co/elasticsearch/elasticsearch:5.0.1)**

I got error message shown in attached file

any idea why this is happening

Thanks in advance for your time

Kind Regards

 ![](https://us1.discourse-cdn.com/elastic/original/2X/9/9582286cb4bdacf80778d4f68713e77899d763b8.PNG)  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/4/406386cc8a33a516f8b1e6ea215e589647445766.PNG)

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [December 3, 2016, 1:29pm UTC](https://discuss.elastic.co/t/elasticsearch-5-0-1-docker-official-image-failing-to-start/67000/6 "2016-12-03T13:29:31Z")

</div>

@cruizpollino I've managed to reproduce this _if_ there are any spaces after `RollingFile` in the line

```auto
appender.rolling.type = RollingFile

```

Can you please confirm whether or not there are such spaces at the end of any of the lines in your `log4j2.properties`, and if the issue stops after removing all such spaces? Otherwise, I am not able to reproduce this with exactly the following content in `log4j2.properties`:

```auto
status = error
appender.rolling.type = RollingFile
appender.rolling.name = rolling
appender.rolling.fileName = ${sys:es.logs}.log
appender.rolling.layout.type = PatternLayout
appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %.10000m%n
appender.rolling.filePattern = ${sys:es.logs}-%d{yyyy-MM-dd}.log
appender.rolling.policies.type = Policies
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.rolling.policies.time.interval = 1
appender.rolling.policies.time.modulate = true
rootLogger.level = info
rootLogger.appenderRef.rolling.ref = rolling

```

with no spaces at the end of any of the lines.

---

<div class="post-metadata">

**Author:** ![cruizpollino](https://avatars.discourse-cdn.com/v4/letter/c/6a8cbe/32.png) [@cruizpollino](https://discuss.elastic.co/u/cruizpollino)\
**Post date:** [December 7, 2016, 10:28am UTC](https://discuss.elastic.co/t/elasticsearch-5-0-1-docker-official-image-failing-to-start/67000/7 "2016-12-07T10:28:09Z")

</div>

Good morning Jason,

sorry for late reply.

You were right there were a space after some of the lines and rolling.type was one of those.

I fixed those lines and now the error is not appearing anymore, now the docker execution commands simply fails with now error message apart from Corrupted prefix and end of stdout lines.

in order to troubleshoot the issue I set docker log-level to debug and run "tail -f /var/log/messages" at same time I run the docker command.

Attached images contain the output during that time period

any idea is really welcome

Kind Regards

* * *

 ![](https://us1.discourse-cdn.com/elastic/original/2X/b/b4aea1369a065f6332e8a1323672cb70ced49985.PNG)  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/6/61ddaad80a97b71e63f3d6e087e0160e05362f28.PNG)  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/2/2eff3811d6f484194d92da965bbd88d9b3ca3f7d.PNG)  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/2/25bc60111821956fc0c5752350d2312b4ae27a49.PNG)  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/9/9b984c65b549ef51885ae8e42bcb908761012245.PNG)

---

<div class="post-metadata">

**Author:** ![cruizpollino](https://avatars.discourse-cdn.com/v4/letter/c/6a8cbe/32.png) [@cruizpollino](https://discuss.elastic.co/u/cruizpollino)\
**Post date:** [December 7, 2016, 10:46am UTC](https://discuss.elastic.co/t/elasticsearch-5-0-1-docker-official-image-failing-to-start/67000/8 "2016-12-07T10:46:47Z")

</div>

in addition to my previous message, i've tried to run

$ docker -D -H unix:///var/run/docker.sock run --cpu-shares 1024 --memory 2634022912 -e ES\_JAVA\_OPTS="-Xms2G -Xmx2G" --net bridge -p 9200:9200/tcp -p 9300:9300/tcp [docker.elastic.co/elasticsearch/elasticsearch:5.0.1](http://docker.elastic.co/elasticsearch/elasticsearch:5.0.1)

and it starts properly, so looks like something in the config files is breaking the start process, but don't know where to look to find what

Regards

---

<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:** [January 4, 2017, 10:46am UTC](https://discuss.elastic.co/t/elasticsearch-5-0-1-docker-official-image-failing-to-start/67000/9 "2017-01-04T10:46:53Z")

</div>

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