Logstash is failing when running as a service due to logstash-core-plugin-api.gemspec error

Hi Team,

My logstash was working completely fine till yesterday and suddenly it stopped working, now when I am trying to restart it using systemctl start logstash command , I am getting below error.

 Check your env for conflicting versions of SnakeYAML
Apr 27 19:12:50 server logstash[21963]: See https://github.com/jruby/jruby/wiki/FAQs#why-does-the-psych-yaml-extension-fail-to-load-in-my-environment
Apr 27 19:12:50 server logstash[21963]: [ERROR] 2021-04-27 19:12:50.178 [main] Logstash - java.lang.IllegalStateException: Logstash stopped processing because of an error: (GemspecError)
Apr 27 19:12:50 server logstash[21963]: [!] There was an error while loading `logstash-core-plugin-api.gemspec`: load error: psych -- java.lang.RuntimeException: BUG: we can not copy embedded jar to temp directory
Apr 27 19:12:50 server logstash[21963]: Does it try to require a relative path? That's been removed in Ruby 1.9. Bundler cannot continue.
Apr 27 19:12:50 server logstash[21963]: #  from /usr/share/logstash/logstash-core-plugin-api/logstash-core-plugin-api.gemspec:23

However, it working fine when I am trying to run it from /usr/share/logstash/bin using below command. Can someone please help

./logstash -f /etc/logstash/conf.d/sample.conf

it is because you don't have permission on /tmp to create a dir.
it will try to create a dir called ls_temp

jvm.options file has this. set this up properly, you can change to different dir if you like

JVM temporary directory

#-Djava.io.tmpdir=${ES_TMPDIR}

1 Like

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