Last active
February 12, 2021 15:52
-
-
Save alexalouit/a857a6de10dfdaf7485f7c0cccadb98c to your computer and use it in GitHub Desktop.
fix Logstash error "logstash load error: ffi/ffi -- java.lang.NullPointerException: null" on Raspbian
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# based on https://github.com/mew2057/CAST/blob/6c7f7d514b7af3c512635ec145aa829c535467dc/csm_big_data/config-scripts/logstashFixupScript.sh | |
# see: https://github.com/elastic/logstash/issues/10755 | |
apt-get update | |
apt-get install -f zip unzip | |
STARTDIR=$(pwd) | |
JARDIR="/usr/share/logstash/logstash-core/lib/jars" | |
JAR="jruby-complete-9.2.9.0.jar" | |
JRUBYDIR="${JAR}-dir" | |
PLATDIR="META-INF/jruby.home/lib/ruby/stdlib/ffi/platform/arm-linux" | |
cd ${JARDIR} | |
unzip -d ${JRUBYDIR} ${JAR} | |
cd "${JRUBYDIR}/${PLATDIR}" | |
cp -n types.conf platform.conf | |
cd "${JARDIR}/${JRUBYDIR}" | |
zip -r ${JAR} * | |
mv -f ${JAR} .. | |
cd ${JARDIR} | |
rm -rf ${JRUBYDIR} | |
chown logstash:logstash ${JAR} | |
sync | |
sync | |
cd ${STARTDIR} |
@gwsales I did manually update my script to ~11.1
It ran successfully and I have confirmed by unzipping the jar file that platfom.conf was actually added to the .jar.
Current release for jruby included in logstash: jruby-complete-9.2.11.1.jar
This script should be updated to auto discover jruby version with a find. I'll get around to it when I have time.
This should work:
JAR=$(basename $(find /usr/share/logstash/logstash-core/lib/jars/ -name "jruby-complete*.jar"))
Thanks, working also for jruby-complete-9.2.11.1.jar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@osuide check the version or checkout this fix.sh that can help you with with newer versions (9.2.9.0+) for jruby / logstash:
https://gist.github.com/gwsales/5a27e6282063f902014d851247c5f448. There has been recent logstash releases that could be using a different version of jruby.