# Logstash fails with "FFI not available" message when starting logstash on Centos 7.9

**URL:** <https://discuss.elastic.co/t/logstash-fails-with-ffi-not-available-message-when-starting-logstash-on-centos-7-9/345387>\
**Category:** Logstash\
**Created:** [October 19, 2023, 12:35pm UTC](https://discuss.elastic.co/t/logstash-fails-with-ffi-not-available-message-when-starting-logstash-on-centos-7-9/345387 "2023-10-19T12:35:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaigbdb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaigbdb/32/74219_2.png) [@shaigbdb](https://discuss.elastic.co/u/shaigbdb)\
**Post date:** [October 19, 2023, 12:35pm UTC](https://discuss.elastic.co/t/logstash-fails-with-ffi-not-available-message-when-starting-logstash-on-centos-7-9/345387/1 "2023-10-19T12:35:12Z")

</div>

**1. Logstash version (e.g. `bin/logstash --version`)** - 8.10.2  
\*\*2. Logstash installation source \*\* - RPM  
\*\*3. How is Logstash being run \*\* - systemd

**JVM** - tried both the bundled JVM (openjdk version "17.0.8" 2023-07-18)  
as well as OpenJDK 11

**OS version** (`uname -a` if on a Unix-like system):  
Linux - 3.10.0-1160.92.1.el7.x86\_64 #1 SMP Tue Jun 20 11:48:01 UTC 2023 x86\_64 x86\_64 x86\_64 GNU/Linux

**Output of ldd --version**  
ldd (GNU libc) 2.17

**Contents of /etc/redhat-release :**  
CentOS Linux release 7.9.2009 (Core)

**Description of the problem** :  
Logstash fails when starting the service with the basic configuration, with the message below. This is similar to the issue described here: [Logstash fails to start on OracleLinux7 · Issue #14873 · elastic/logstash · GitHub](https://github.com/elastic/logstash/issues/14873)

This occurs on a virtual machine installed locally. I've attempted the same on AWS with a CentOS 7.9 AMI (ami-0aedf6b1cb669b4c7) and could not reproduce the issue.  
Only difference I found between the machines is that uname -a has a somewhat different output:  
Linux ip-xxx-xxx-xxx-xxx.ec2.internal 3.10.0-1160.80.1.el7.x86\_64 #1 SMP Tue Nov 8 15:48:59 UTC 2022 x86\_64 x86\_64 x86\_64 GNU/Linux

Logstash has full permissions for the tmpdir.

```auto
[INFO][logstash.runner] Starting Logstash {"logstash.version"=>"8.10.2", "jruby.version"=>"jruby 9.4.2.0 (3.1.0) 2023-03-08 90d2913fda OpenJDK 64-Bit Server VM 17.0.8+7 on 17.0.8+7 +indy +jit [x86_64-linux]"}
[INFO][logstash.runner] JVM bootstrap flags: [-Xms1g, -Xmx1g, -Djava.io.tmpdir=$HOME, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djruby.compile.invokedynamic=true, -XX:+HeapDumpOnOutOfMemoryError, -Djava.security.egd=file:/dev/urandom, -Dlog4j2.isThreadContextMapInheritable=true, -Djruby.native.verbose=true, -Djruby.regexp.interruptible=true, -Djdk.io.File.enableADS=true, --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED, --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED, --add-opens=java.base/java.security=ALL-UNNAMED, --add-opens=java.base/java.io=ALL-UNNAMED, --add-opens=java.base/java.nio.channels=ALL-UNNAMED, --add-opens=java.base/sun.nio.ch=ALL-UNNAMED, --add-opens=java.management/sun.management=ALL-UNNAMED]
[2023-10-10T12:39:46,289][FATAL][org.logstash.Logstash] Logstash stopped processing because of an error: (LoadError) Could not load FFI Provider: (NotImplementedError) FFI not available: null
 See http://jira.codehaus.org/browse/JRUBY-4583
org.jruby.exceptions.LoadError: (LoadError) Could not load FFI Provider: (NotImplementedError) FFI not available: null
 See http://jira.codehaus.org/browse/JRUBY-4583
	at org.jruby.ext.jruby.JRubyUtilLibrary.load_ext(org/jruby/ext/jruby/JRubyUtilLibrary.java:216) ~[jruby.jar:?]
	at RUBY.<main>(/usr/share/logstash/vendor/bundle/jruby/3.1.0/gems/ffi-1.15.5-java/lib/ffi.rb:11) ~[?:?]
	at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1057) ~[jruby.jar:?]
	at RUBY.<module:LibC>(/usr/share/logstash/logstash-core/lib/logstash/util/prctl.rb:19) ~[?:?]
	at RUBY.<main>(/usr/share/logstash/logstash-core/lib/logstash/util/prctl.rb:18) ~[?:?]
	at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1057) ~[jruby.jar:?]
	at RUBY.set_thread_name(/usr/share/logstash/logstash-core/lib/logstash/util.rb:36) ~[?:?]
	at RUBY.execute(/usr/share/logstash/logstash-core/lib/logstash/runner.rb:365) ~[?:?]
	at RUBY.run(/usr/share/logstash/vendor/bundle/jruby/3.1.0/gems/clamp-1.0.1/lib/clamp/command.rb:68) ~[?:?]
	at RUBY.run(/usr/share/logstash/logstash-core/lib/logstash/runner.rb:287) ~[?:?]
	at RUBY.run(/usr/share/logstash/vendor/bundle/jruby/3.1.0/gems/clamp-1.0.1/lib/clamp/command.rb:133) ~[?:?]
	at usr.share.logstash.lib.bootstrap.environment.<main>(/usr/share/logstash/lib/bootstrap/environment.rb:89) ~[?:?]
Caused by: org.jruby.exceptions.NotImplementedError: (NotImplementedError) FFI not available: null

```

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [October 19, 2023, 1:21pm UTC](https://discuss.elastic.co/t/logstash-fails-with-ffi-not-available-message-when-starting-logstash-on-centos-7-9/345387/2 "2023-10-19T13:21:15Z")

</div>

Check [this](https://discuss.elastic.co/t/logstash-stop-working-due-to-ffi-not-available-null/343174) and, as Leandro recommended, change tmp path in jvm.options.  
`-Djava.io.tmpdir=/opt/logstash_tmp` or any other directory on which logstash user has write rights.

---

<div class="post-metadata">

**Author:** ![shaigbdb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaigbdb/32/74219_2.png) [@shaigbdb](https://discuss.elastic.co/u/shaigbdb)\
**Post date:** [October 25, 2023, 3:37pm UTC](https://discuss.elastic.co/t/logstash-fails-with-ffi-not-available-message-when-starting-logstash-on-centos-7-9/345387/3 "2023-10-25T15:37:59Z")

</div>

It was the parent folder of tmpdir. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 22, 2023, 3:38pm UTC](https://discuss.elastic.co/t/logstash-fails-with-ffi-not-available-message-when-starting-logstash-on-centos-7-9/345387/4 "2023-11-22T15:38:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
