logstash icon indicating copy to clipboard operation
logstash copied to clipboard

JRuby fails to load on ppc64le

Open mew2057 opened this issue 5 years ago • 8 comments

The following is a reproduction of the issue on the jruby issue tracker

I wrote a patch script to repair the jar for our environment.

Environment

  • JRuby bundled in logstash 7.0.0 ( jar is jruby-complete-9.2.7.0.jar)
  • Linux h1 4.14.0-29.el7a.ppc64le #1 SMP Mon Jan 22 16:26:32 EST 2018 ppc64le ppc64le ppc64le GNU/Linux

Other relevant info you may wish to add:

  • Application : Logstash

Expected Behavior

  • When running the environment.rb JRuby should load all modules without exiting execution.

Actual Behavior

  • When the JRuby Application (logstash) is loaded a LoadError is thrown by ffi/ffi. The bubbled error message is somewhat vague (to a user ignorant to JRuby).
[2019-05-03T10:41:38,701][ERROR][org.logstash.Logstash    ] 
java.lang.IllegalStateException: Logstash stopped processing because of an error: 
(LoadError) load error: ffi/ffi -- java.lang.NullPointerException: null

Resolution

I was able to trace the bug to jruby/lib/ruby/stdlib/ffi/platform/powerpc64-linux/. It looks as though the platform.conf file was not created for this platform. Copying the types.conf file to platform.conf appears to resolve the problem.

mew2057 avatar May 03 '19 14:05 mew2057

@mew2057 have you seen this on logstash 6.x.x versions too? I see it on 6.7 at least There are containers out there that are on logstash 5.x.x https://hub.docker.com/r/ibmcom/logstash. It's multi-arch, even though it says amd64

scprek avatar May 03 '19 14:05 scprek

The last level we worked with on our ppc64le machines was 6.3.1, which didn't present the error. We were waiting for the 7.0.0 version before updating for the feature add.

mew2057 avatar May 03 '19 14:05 mew2057

@scprek Logstash 6.7.x is likely affected, as it bundles the same jruby as 7.x (unverified).

@mew2057 thanks for the clear description here and for filing the bug upstream. We will work to get the upstream fix included in a future distribution of Logstash.

yaauie avatar May 03 '19 16:05 yaauie

JRuby folks are willing to help figure this out, but without access to a PPC environment it's very difficult for us to investigate. Perhaps you can suggest a PPC cloud or similar environment we could use?

headius avatar Jun 24 '19 22:06 headius

I had the same error with jruby-complete-9.2.8.0.jar on Redhat 8.0 ppc64le (IBM POWER9). It was fixed by copying the missing platform.conf from types.conf, as suggested above. Thanks.

For the folks new to this, I summarized what I tested here.

nasica88 avatar Nov 13 '19 05:11 nasica88

I've just fixed the issue with this script: https://gist.github.com/alexalouit/a857a6de10dfdaf7485f7c0cccadb98c

I have now logstash 7.3.2 in a Raspberry Pi 4 with Buster :tada:

goferito avatar Nov 16 '19 22:11 goferito

With the 7.9.0 release of Logstash, we believe this class of error should have been fixed. We have not tested on this particular hardware, and would appreciate any updates to the status of this issue and whether the issue is still present.

This appeared to have been caused by jruby/jruby#6219, where during ffi loading platform configuration files, an unhandled NPE would be thrown, rather than the handled file NotFound when attempting to load platform.conf, resulting in the error shown here.

This was fixed by this commit, included in the version of jruby shipped with logstash 7.9.0

robbavey avatar Sep 03 '20 18:09 robbavey

Hi, just hit this issue with 7.8.0 and I can confirm that upgrading to 7.17.16 (latest 7.x as of writing this) solves it.

Machine is ppc64le, IBM Power9 CPU, on Linux.

AlbertoGP avatar Dec 16 '23 08:12 AlbertoGP