logstash icon indicating copy to clipboard operation
logstash copied to clipboard

Logstash `6.8.11` doesn't start if it started from a symbolic link

Open andsel opened this issue 5 years ago • 5 comments

  • Version: 6.8.11
  • Operating System: Linux, maybe MacOSX
  • Steps to Reproduce: run docker with Dockerfile
FROM logstash:6.8.11
USER logstash
RUN ln -s /usr/share/logstash /tmp/log
RUN echo "input { stdin {} } output { stdout {} }" > cfg
# uncomment these to make "docker build ." work
#RUN rm -r ./vendor/bundle/jruby/2.5.0/gems/ffi-1.13.1-java/lib/ffi
#RUN rm ./vendor/bundle/jruby/2.5.0/gems/ffi-1.13.1-java/lib/ffi.rb
RUN /tmp/log/bin/logstash -f cfg

Description Logstash 6.8.11 ships with JRuby 9.2.7.0 and ffi gem 1.13.1 when launched with a symbolic link fails with:

[2020-08-13T15:21:29,762][FATAL][logstash.runner          ] An unexpected error occurred! {:error=>#<NameError: uninitialized constant LibC::FFI>, :backtrace=>[
	"org/jruby/RubyModule.java:3742:in `const_missing'", 
	"/usr/share/logstash/logstash-core/lib/logstash/util/prctl.rb:4:in `<module:LibC>'", 
	"/usr/share/logstash/logstash-core/lib/logstash/util/prctl.rb:2:in `<main>'", 
	"org/jruby/RubyKernel.java:987:in `require'", 
	"/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'", 
	"/usr/share/logstash/logstash-core/lib/logstash/util.rb:21:in `set_thread_name'", 
	"/usr/share/logstash/logstash-core/lib/logstash/runner.rb:306:in `execute'", 
	"/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'", 
	"/usr/share/logstash/logstash-core/lib/logstash/runner.rb:237:in `run'", 
	"/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'", 
	"/home/andrea/workspace/elastic_products/my_ls/lib/bootstrap/environment.rb:73:in `<main>'"

the things to note is:

  • Logstash 6.8.10 doesn't manifest the problem, it ships with JRuby 9.2.7.0 and ffi gem 1.11.3
  • Logstash 7.8.1 doesn't manifest the problem, it ships with JRuby 9.2.11.1 and ffi gem 1.13.1 and they doesn't manifest the problem.

Removing the gem make Logstash starts happily.

andsel avatar Aug 13 '20 16:08 andsel

I´ve got a similiar behavior for logstash 6.8.13. Version: 6.8.13 Operating System: Linux Steps to Reproduce:

  • extracted logstash from tar file
  • created a sym link to new dir
lrwxrwxrwx   1 elk  elk         29 Jan  9 11:47 logstash -> /products/elk/logstash-6.3.2/
drwxrwxr-x  14 elk  elk       4096 Sep  6  2018 logstash-6.3.2
drwxr-xr-x  13 elk  elk       4096 Jan  8 16:12 logstash-6.8.13
  • after starting the new logstash instance, I got this error:
[2021-01-09T11:24:12,800][FATAL][logstash.runner          ] An unexpected error occurred! {:error=>#<NameError: uninitialized constant LibC::FFI>, :backtrace=>["org/jruby/RubyModule.java
:3742:in `const_missing'", "/products/elk/logstash-6.8.13/logstash-core/lib/logstash/util/prctl.rb:4:in `<module:LibC>'", "/products/elk/logstash-6.8.13/logstash-core/lib/logstash/util/p
rctl.rb:2:in `<main>'", "org/jruby/RubyKernel.java:987:in `require'", "/products/elk/logstash-6.8.13/vendor/bundle/jruby/2.5.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'", "/pro
ducts/elk/logstash-6.8.13/logstash-core/lib/logstash/util.rb:1:in `(root)'", "/products/elk/logstash-6.8.13/logstash-core/lib/logstash/util.rb:21:in `set_thread_name'", "/products/elk/lo
gstash-6.8.13/logstash-core/lib/logstash/runner.rb:306:in `execute'", "/products/elk/logstash-6.8.13/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'", "/produ
cts/elk/logstash-6.8.13/logstash-core/lib/logstash/runner.rb:237:in `run'", "/products/elk/logstash/lib/bootstrap/environment.rb:73:in `<main>'"]}
[2021-01-09T11:24:12,802][ERROR][org.logstash.Logstash    ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

cfubrz avatar Jan 11 '21 11:01 cfubrz

Same behavior on 6.8.22, we're also using sym links to manage releases. Can confirm that removing the gem (vendor/bundle/jruby/2.5.0/gems/ffi-1.15.3-java) helps and logstash is able to start. No idea what this could break though.

kdask avatar Jan 13 '22 21:01 kdask

Seeing the same behavior on 6.8.23. We also use symlinks to manage releases. Also confirmed that removing the ffi gem allowed logstash to start. No idea the impact that has.

jburns24 avatar Jul 29 '22 23:07 jburns24

I've tested with Logstash 7.17.5 and the problem doesn't appear. Logstash 6.8.x EOLed on 2022-02-10 when 8.0.0 was released. So I think we could close this issue. /cc @roaksoax

andsel avatar Aug 02 '22 10:08 andsel