<p dir="auto">Hello! The Chef cookbook for Elasticsearch has received a bug report regarding the packaging of ES, specifically the init scripts and status reporting. Here's the actual report: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="163777422" data-permission-text="Title is private" data-url="https://github.com/sous-chefs/elasticsearch/issues/483" data-hovercard-type="issue" data-hovercard-url="/sous-chefs/elasticsearch/issues/483/hovercard" href="https://github.com/sous-chefs/elasticsearch/issues/483">sous-chefs/elasticsearch#483</a></p>
<p dir="auto">In short, the user is seeing the init script for Ubuntu 14.04 report "OK" when starting Elasticsearch, even though parsing of the YAML configuration file has failed. Perhaps Elasticsearch needs a 'configtest' akin to the way Apache and Nginx have implemented it, or perhaps the init script just needs improvement to catch when Elasticsearch has exited or failed to start.</p>
<p dir="auto"><strong>Elasticsearch version</strong>: 2.3.3<br>
<strong>JVM version</strong>: 1.8.0_91<br>
<strong>OS version</strong>: ubuntu 14.04</p>
<p dir="auto"><strong>Steps to reproduce</strong>:</p>
<ol dir="auto">
<li>Add <code class="notranslate">http.cors.allow-origin: *</code> to elasticsearch.yml</li>
<li>Attempt to start the service</li>
</ol>
<p dir="auto"><strong>Provide logs (if relevant)</strong>:<br>
The user reporting the issue found this in his logs:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Exception in thread &quot;main&quot; SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: ScannerException[while scanning an alias
 in 'reader', line 41, column 25:
    http.cors.allow-origin: *
                            ^
expected alphabetic or numeric character, but found but found

 in 'reader', line 41, column 26:
    http.cors.allow-origin: *
                             ^
];
Likely root cause: while scanning an alias
 in 'reader', line 41, column 25:
    http.cors.allow-origin: *
                            ^"><pre class="notranslate"><code class="notranslate">Exception in thread "main" SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: ScannerException[while scanning an alias
 in 'reader', line 41, column 25:
    http.cors.allow-origin: *
                            ^
expected alphabetic or numeric character, but found but found

 in 'reader', line 41, column 26:
    http.cors.allow-origin: *
                             ^
];
Likely root cause: while scanning an alias
 in 'reader', line 41, column 25:
    http.cors.allow-origin: *
                            ^
</code></pre></div>
<p dir="auto">On ubuntu 14.04 for Elasticsearch 1.7.0 debian package,<br>
If we start twice elasticsearch very shortly, the pidofproc function doesn't return the PID of the first elasticsearch.<br>
So 2 elasticsearch can be started at the same time. In my case this causes an OOM trigger.</p>
<p dir="auto">How to reproduce:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# service elasticsearch stop
# service elasticsearch start; service elasticsearch start; "><pre class="notranslate"><code class="notranslate"># service elasticsearch stop
# service elasticsearch start; service elasticsearch start; 
</code></pre></div>