Cannot start service after Elasticsearch upgrade from 1.4.1 to 1.4.4
Asked Answered
G

7

20

I have installed Elasticsearch successfully on Windows 7 version x64, using ELS 1.4.1. After upgrading to Kibana 4 RTM, it required ELS 1.4.4.

To carry out the upgrade, I performed the following steps:

  1. Downloaded ELS 1.4.4
  2. Stopped and removed the ELS 1.4.1 service
  3. Renamed the current install directory to elasticsearch_bak
  4. Extracted the 1.4.4 zip to the elasticsearch directory
  5. Compared the /config/elasticsearch.yml and config/logging.yml and applied the changes (which contains the following additional settings at the bottom)
# Helps Chrome work properly
http.cors.allow-origin: "/.*/"
http.cors.enabled: true

Upon starting the service, it stops within a few seconds. The logs are as follows:

Java Version

(Note this is for development purposes)

java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) Client VM (build 25.31-b07, mixed mode, sharing)

Event Log

The Elasticsearch 1.4.4 (elasticsearch) service terminated with service-specific error Incorrect function..

elasticsearch-stderr-2015.05.20.log

2015-02-20 08:49:13 Commons Daemon procrun stderr initialized
Exception in thread "main" ror: Could not initialize class org.elasticsearch.Version
    at org.elasticsearch.bootstrap.Bootstrap.buildErrorMessage(Bootstrap.java:254)
    at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:238)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
The data area passed to a system call is too small.

Failed to start service

elasticsearch-stdout-2015.05.20.log

2015-02-20 08:46:03 Commons Daemon procrun stdout initialized

elasticsearch.2015-02-20.log

[2015-02-20 08:49:14] [info]  ( prunsrv.c:1284) [ 8560] Service started in 1198 ms.
[2015-02-20 08:49:14] [debug] ( prunsrv.c:844 ) [ 8560] reportServiceStatusE: 4, 0, 0, 0
[2015-02-20 08:49:14] [debug] ( prunsrv.c:1528) [ 8560] Waiting for worker to finish...
[2015-02-20 08:49:14] [debug] ( prunsrv.c:1533) [ 8560] Worker finished.
[2015-02-20 08:49:14] [debug] ( prunsrv.c:1559) [ 8560] Waiting for all threads to exit
[2015-02-20 08:49:14] [debug] ( prunsrv.c:844 ) [ 8560] reportServiceStatusE: 3, 0, 0, 0
[2015-02-20 08:49:14] [debug] ( prunsrv.c:1563) [ 8560] JVM destroyed.
[2015-02-20 08:49:14] [debug] ( prunsrv.c:844 ) [ 8560] reportServiceStatusE: 1, 1066, 0, 1
[2015-02-20 08:49:14] [info]  ( prunsrv.c:1598) [10064] Run service finished.
[2015-02-20 08:49:14] [info]  ( prunsrv.c:1764) [10064] Commons Daemon procrun finished
[2015-02-20 08:49:14] [info]  ( prunsrv.c:1764) [10064] Commons Daemon procrun finished
[2015-02-20 08:49:16] [error] ( prunsrv.c:746 ) [10116] Failed to start 'elasticsearch' service
[2015-02-20 08:49:16] [error] ( prunsrv.c:746 ) [10116] The data area passed to a system call is too small.
[2015-02-20 08:49:16] [info]  ( prunsrv.c:754 ) [10116] Start service finished.
[2015-02-20 08:49:16] [error] ( prunsrv.c:1755) [10116] Commons Daemon procrun failed with exit value: 5 (Failed to start service)
[2015-02-20 08:49:16] [error] ( prunsrv.c:1755) [10116] The data area passed to a system call is too small.

If I run elasticsearch from the command prompt, I get this error:

c:\elk\elasticsearch\bin>elasticsearch
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.Version
        at org.elasticsearch.bootstrap.Bootstrap.buildErrorMessage(Bootstrap.java:254)
        at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:238)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
Gudgeon answered 20/2, 2015 at 8:54 Comment(0)
L
27

I had the exact same issue and here is how I've fixed it.

Here is my setup

I am using Windows Server 2008 R2 Enterprise - 64-bit version. Everything worked fine with Java (JRE) version 1.8.0_25. Elastic search was installed as Windows Service.

Exactly before the issue I updated Java to version 1.8.0_31 and restarted the machine.

Here is the history of steps I took

Firstly after restarting the machine I've noticed that ElasticSearch service was stopped. After trying to start it it stopped again.

Here is what I get in my Events Log for the issue:

The Elasticsearch 1.4.1 (elasticsearch-service-x64) service terminated with service-specific error Incorrect function..

Here is what I had in my elasticsearch-service-x64.2015-02-27.log:

[2015-02-27 14:38:29] [info]  [ 4948] Commons Daemon procrun (1.0.15.0 64-bit) started
[2015-02-27 14:38:29] [info]  [ 4948] Running 'elasticsearch-service-x64' Service...
[2015-02-27 14:38:29] [info]  [ 3048] Starting service...
[2015-02-27 14:38:29] [error] [ 3048] Failed creating java C:\Program Files\Java\jre1.8.0_25\bin\server\jvm.dll
[2015-02-27 14:38:29] [error] [ 3048] The system cannot find the path specified.
[2015-02-27 14:38:29] [error] [ 3048] ServiceStart returned 1
[2015-02-27 14:38:29] [error] [ 3048] The system cannot find the path specified.
[2015-02-27 14:38:29] [info]  [ 4948] Run service finished.
[2015-02-27 14:38:29] [info]  [ 4948] Commons Daemon procrun finished

Then I've changed the value of JAVA_HOME system variable to C:\Program Files\Java\jre1.8.0_31

enter image description here

The issue then was:

Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.Version
        at org.elasticsearch.bootstrap.Bootstrap.buildErrorMessage(Bootstrap.java:254)
        at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:238)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)

What fixed the problem

  1. I've completely deleted folders bin, config, lib and plugins from the ElasticSearch folder.

    Be sure to not to delete data directory because there are located your indexes!

  2. Unzipped the same folders (bin, config and lib) from elasticsearch-1.4.4.zip.
  3. Ran SC DELETE elasticsearch-service-x64 as administrator in Command Prompt (to delete the installed service)
  4. Ran F:\Services\elasticsearch\bin>service.bat install

    Installing service      :  "elasticsearch-service-x64"
    Using JAVA_HOME (64-bit):  "C:\Program Files\Java\jre1.8.0_31"
    The service 'elasticsearch-service-x64' has been installed.
    
  5. Started the service

And then everything started to work correctly.

enter image description here

Lateshalatest answered 27/2, 2015 at 13:18 Comment(3)
There is no need for first step, it worked for me without it.Stockdale
I've also seen this error happen with plugins that are incompatible with the latest version.Middlebrooks
Long story short: 1) update JAVA_HOME to new java version 2) in elasticsearch bin directory run: service remove; service install; service startEmlen
D
18

I have the same problem. Its appear after update to new version of Java. Although I change value of "JAVA_HOME" variable to new java directory, the problem stay.

Than I go to command prompt, navigate to ES directory and run the following command:

{ElasticSearch directory}\bin>service manager

This command will open Elasticsearch properties window.(https://i.sstatic.net/QQEPG.png)

Than go to Java tab and change path of Java Virtual Machine to new version of Java. After that just run ES service

{ElasticSearch directory}\bin>service start
Damask answered 1/9, 2015 at 14:12 Comment(0)
R
13

The issue is caused by service.bat distributed with Elastic which rely on Apache Common Procrun and sets the JVM using the environment variable %JAVA_HOME% which is not resolved correctly.

So I fixed the issue by setting "Default JVM" on the GUI that appears with service.bat manager.

Another way to fix the issue via command line is

elasticsearch-service-x64.exe //US//YOUR_SERVICE_NAME --Jvm auto

i.e.

elasticsearch-service-x64.exe //US//elasticsearch-service-x64 --Jvm auto
Roast answered 18/3, 2016 at 18:48 Comment(0)
O
3

Updated the JDK from jdk1.7.0_21 to jdk1.8.0_77.Changed the Java_Home and it started working fine.

Ozenfant answered 2/4, 2016 at 2:16 Comment(0)
L
2

What worked for me was to run "service manager" within the bin folder and set the JVM to default.

Lasser answered 16/2, 2017 at 10:45 Comment(0)
H
1

I had another version of elasticsearch installed. Simply removing old version worked for me.

elasticsearch-2.0.0\bin>service remove

Halation answered 11/11, 2015 at 0:35 Comment(0)
S
1

I ran into the same issue, and even with the proper JAVA_HOME system variable set, it did not work.

Eventually I navigated to the bin folder of my elastic search install and ran:

service manager

Within the manager, under the Java tab, I set these options

-Delasticsearch
-Des.path.home=C:\elasticsearch-2.4.5
-Des.default.path.logs=C:\elasticsearch-2.4.5\logs
-Des.default.path.data=C:\elasticsearch-2.4.5\data
-Des.default.path.conf=C:\elasticsearch-2.4.5\config

Saved the changes, and then ran

service start
Sverdlovsk answered 23/2, 2018 at 18:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.