Logstash runner error

[2022-02-16T14:02:47,966][INFO ][logstash.runner          ] Log4j configuration path used is: /etc/logstash/log4j2.properties
[2022-02-16T14:02:47,980][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=>"7.15.1", "jruby.version"=>"jruby 9.2.19.0 (2.5.8) 2021-06-15 55810c552b OpenJDK 64-Bit Server VM 11.0.12+7 on 11.0.12+7 +indy +jit [linux-x86_64]"}
[2022-02-16T14:02:49,544][FATAL][logstash.runner          ] An unexpected error occurred! {:error=>#<ArgumentError: wrong number of arguments (given 3, expected 1..2)>, :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/api/modules/base.rb:-1:in `initialize'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sinatra-2.2.0/lib/sinatra/base.rb:1537:in `new'", "/usr/share/logstash/logstash-core/lib/logstash/api/rack_app.rb:113:in `block in app'", "org/jruby/RubyBasicObject.java:2622:in `instance_eval'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rack-2.2.3/lib/rack/builder.rb:125:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/api/rack_app.rb:101:in `app'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:99:in `start_webserver'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:60:in `block in run'", "org/jruby/RubyRange.java:526:in `each'", "org/jruby/RubyEnumerable.java:1258:in `each_with_index'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:55:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:450:in `block in start_webserver'"]}
[2022-02-16T14:02:49,554][FATAL][org.logstash.Logstash    ] Logstash stopped processing because of an error: (SystemExit) exit
org.jruby.exceptions.SystemExit: (SystemExit) exit
	at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:747) ~[jruby-complete-9.2.19.0.jar:?]
	at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:710) ~[jruby-complete-9.2.19.0.jar:?]
	at usr.share.logstash.lib.bootstrap.environment.<main>(/usr/share/logstash/lib/bootstrap/environment.rb:94) ~[?:?]

After restarting the Logstash, it triggered the above error and can't run the Logstash.

The version of Logstash is Logstash-7.15.1-amd64

No specific conf filter.

Pls help to resolve the problem, thanks.

When I install the logstash-output-http version 5.2.5 plugin (/usr/share/logstash/bin/logstash-plugin install logstash-output-http) the logstash-mixin-http_client dependency is downloaded which updates Sinatra from the version 2.1.0 to 2.2.0.
Logstash with this library crashes with this error:
An unexpected error occurred! {: error => # <ArgumentError: wrong number of arguments (given 3, expected 1..2)>

Analyzing sinatra 2.2.0 ("/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sinatra-2.2.0/lib/sinatra/base.rb) line 1537 it can be seen that the ** kwargs parameter in addiction compared to version 2.1.0

def new (* args, ** kwargs, & bk)
instance = new! (* args, ** kwargs, & bk)
Wrapper.new (build (instance) .to_app, instance)

For the moment I managed to solve the problem by installing the http plugin with the --preserve option which DOES NOT automatically update the logstash-mixin-http_client dependency and therefore keeps Sinatra at version 2.1.0
/usr/share/logstash/bin/logstash-plugin install --preserve logstash-output-http
But it is not correct for a plugin update to break logstash

Thanks for your reply.
Does that mean the fatal was triggered by the plugin version?

No it is not due to the plugin update, but it is due to the update of the logstash-mixin-http_client plugin dependency which depends on the Sinatra library, which updated from version 2.1 to 2.2 has an incorrect parameter in the variables that prevent logstash from be executed.
For the moment the only method is to reinstall all logstash from apt-get, remove the Sinatra 2.2 library and leave only the 2.1, then reactivate the plugin with the --preserve option so it won't download the new dependencies

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