# Elasticsearch 5.0.1 service not starting when managed by Puppet module on Ubuntu 14.04

**URL:** <https://discuss.elastic.co/t/elasticsearch-5-0-1-service-not-starting-when-managed-by-puppet-module-on-ubuntu-14-04/66754>\
**Category:** Elasticsearch\
**Created:** [November 21, 2016, 4:50pm UTC](https://discuss.elastic.co/t/elasticsearch-5-0-1-service-not-starting-when-managed-by-puppet-module-on-ubuntu-14-04/66754 "2016-11-21T16:50:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erikanderson753](https://avatars.discourse-cdn.com/v4/letter/e/ecd19e/32.png) [@erikanderson753](https://discuss.elastic.co/u/erikanderson753)\
**Post date:** [November 21, 2016, 4:50pm UTC](https://discuss.elastic.co/t/elasticsearch-5-0-1-service-not-starting-when-managed-by-puppet-module-on-ubuntu-14-04/66754/1 "2016-11-21T16:50:04Z")

</div>

I am testing an upgrade from Elasticsearch 2.4.1 to Elasticsearch 5.0.1 on Ubuntu 14.04. It is being configured by the newest version of the [puppet-elasticsearch](https://forge.puppet.com/elasticsearch/elasticsearch/readme) module (0.15.0) I ran the elasticsearch-migration module and it all checked out prior to me installing Elasticsearch 5.0.1

The issue I am facing is that the Elasticsearch instance service is not starting. It seems like there is an error which is not being caught since it returns `ok` when I attempt to start it. I am actively debugging it at the moment and will post my findings here when and if I find a solution but any feedback is appreciated.

Current init script: [https://gist.github.com/erikanderson/fad9360aa317be3a3755d599f7b7b987](https://gist.github.com/erikanderson/fad9360aa317be3a3755d599f7b7b987)

Edit 1:

I tried adding this line above the start-stop-daemon (from [http://sandlininc.com/?p=747](http://sandlininc.com/?p=747))  
`log_daemon_msg "sudo -u $ES_USER $DAEMON $DAEMON_OPTS"`  
which gave me this command to run:  
`sudo -u elasticsearch /usr/share/elasticsearch/bin/elasticsearch -d -p /var/run/elasticsearch-logyard.pid -Edefault.path.conf=/etc/elasticsearch/logyard -Edefault.path.data=/usr/share/elasticsearch/data -Edefault.path.home=/usr/share/elasticsearch -Edefault.path.logs=/var/log/elasticsearch/logyard`  
When I ran this it started the service successfully

Edit 2:

Once I disabled detaching the process in the start-stop-daemon (option -b) I got this error:  
`Error: encountered environment variables that are no longer supported Use jvm.options or ES_JAVA_OPTS to configure the JVM ES_HEAP_SIZE=4g: set -Xms4g and -Xmx4g in jvm.options or add "-Xms4g -Xmx4g" to ES_JAVA_OPTS`

Edit 3: The process starts up now that `ES_HEAP_SIZE` is no longer set in the defaults file

Edit 4: Now it starts up but exits almost immediately with no errors or logs ☹

Edit 5: The reason it was stopping immediately was because the bootstrap checks failed  
`[2016-11-21T12:29:24,634][ERROR][o.e.b.Bootstrap] [****] node validation exception bootstrap checks failed memory locking requested for elasticsearch process but memory is not locked`  
I commented out this setting and its working `bootstrap.memory_lock: true`  
WIll have to address the mem lock issue before I can use that setting

---

<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:** [December 19, 2016, 4:50pm UTC](https://discuss.elastic.co/t/elasticsearch-5-0-1-service-not-starting-when-managed-by-puppet-module-on-ubuntu-14-04/66754/2 "2016-12-19T16:50:16Z")

</div>

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