While updating logstash 1.4.2 we encounter - Unable to find JRuby error

ok I have checked /etc/init.d/logstash with working logstash 2.1.0 environment & found 1 difference --
export PATH HOME LS_HEAP_SIZE LS_JAVA_OPTS LS_USE_GC_LOGGING JAVACMD

After adding above entry in /etc/init.d/logstash still it is not working ..

echo $JAVA_HOME

/usr/bin/java

one thing to note is -- If we downgrade this logstash 2.1.0 to 1.4.2 version by YUM it works.
After downgrading I could see the logstash.lib & logstash files are as it is but still it works.

So it looks to me something with 1.4.2 binary .. not with config ..

The ERROR still exists in logstash.err --

tail -f /var/log/logstash/logstash.err

Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME.

Could you please help in this regards..

After adding above entry in /etc/init.d/logstash still it is not working ..

echo $JAVA_HOME
/usr/bin/java

Wait, what? JAVA_HOME should not point to /usr/bin/java. It should point to the root directory of the JVM—/usr/lib/jvm/java-8-oracle/jre or similar. /usr/bin/java is probably a (possibly recursive) symlink. Follow it until you find the JVM directory.

[root@xyz ~]# echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-0.b17.el6_7.x86_64/jre
[root@xyz ~]#
[root@xyz ~]# service logstash status
logstash is not running
[root@xyz ~]# service logstash start
logstash started.
[root@xyz ~]# date; service logstash status
Tue Dec 8 03:19:24 EST 2015
logstash is not running
[root@xyz ~]# rpm -qa | grep logstash
logstash-2.1.0-1.noarch
[root@xyz ~]#
[root@xyz ~]# tail -f /var/log/logstash/logstash.err
Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME.
^C
[root@xyz ~]# ls -l /var/log/logstash/logstash.err
-rw-r--r-- 1 root root 94 Dec 8 03:19 /var/log/logstash/logstash.err
[root@xyz ~]#

I just downgraded logstash to previous version , no configuration changes & it works ..

[root@xyz ~]# rpm -qa | grep logstash
logstash-1.4.2-1_2c0f5a1.noarch
[root@xyz ~]#
[root@xyz ~]# date; service logstash status
Tue Dec 8 03:27:22 EST 2015
logstash is not running
[root@xyz ~]# ls -l /opt/logstash/bin/
total 36
-rwxr-xr-x 1 logstash logstash 1338 Jun 24 2014 logstash
-rw-rw-r-- 1 logstash logstash 2651 Jun 24 2014 logstash.bat
-rwxrwxr-x 1 logstash logstash 2716 Jun 24 2014 logstash.lib.sh
-rwxr-xr-x 1 logstash logstash 4377 Dec 2 02:26 logstash.lib.sh_original
-rwxr-xr-x 1 logstash logstash 1086 Dec 2 02:27 logstash_original
-rwxrwxr-x 1 logstash logstash 84 Jun 24 2014 logstash-test
-rwxrwxr-x 1 logstash logstash 82 Jun 24 2014 logstash-web
-rwxrwxr-x 1 logstash logstash 1531 Jun 24 2014 plugin
[root@xyz ~]# service logstash start
logstash started.
[root@xyz ~]# service logstash status
logstash is running
[root@xyz ~]# tail -f /var/log/logstash/logstash.err
^C
[root@xyz ~]#

Please let me know can we use these logstash, logstash.lib files for version 2.1.0..

We are trying to update layer by Layer now --

1] Logstash 1.4.2 --> Logstash 1.5.1 [ Successful ].
2] Logstash 1.5.1 --> Logstash 1.5.2 [ Successful ].
3] Logstash 1.5.2 update to any version fails e.g 2.0.0, 2.1.0.

So its strong indication that there is an issue with binary.

Could you please provide how we can resolve this issue.

Thanks,

Datta

There's a strong indication that something changed in the startup scripts between 1.5.2 and 2.0.0. Logstash complains about not being able to find the JVM so it's pretty clear what the problem is. Did you try setting JAVA_HOME in the init script (or, actually, in /etc/sysconfig/logstash which is sourced from the init script)? Setting it in the shell from which you invoke service logstash start doesn't make a difference.

Unless new information comes to light I have nothing more to add in this matter.