Pipeline number of arguments error

Hi,

For some reason I have started to get the following fatal error with logstash 8.0.0.

 [LogStash::Runner] 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:43: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:123:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:74:in `from_settings'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:69:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:508:in `create_agent'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:399:in `execute'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-1.0.1/lib/clamp/command.rb:68:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:282:in `run'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-1.0.1/lib/clamp/command.rb:133:in `run'", "/usr/share/logstash/lib/bootstrap/environment.rb:93:in `<main>'"]}
[FATAL] 2022-02-16 12:00:07.550 [LogStash::Runner] 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:43: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:123:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/webserver.rb:74:in `from_settings'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:69:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:508:in `create_agent'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:399:in `execute'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-1.0.1/lib/clamp/command.rb:68:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:282:in `run'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-1.0.1/lib/clamp/command.rb:133:in `run'", "/usr/share/logstash/lib/bootstrap/environment.rb:93:in `<main>'"]}

I have no idea how to go about debugging what the issue is.
I have simplified my config (see below) but am still getting the error.

input {
    s3 {
		access_key_id => "${AWS_ACCESS_KEY}"
        secret_access_key => "${AWS_SECRET}"
        bucket => "${S3_BUCKET}"
		prefix => "${S3_PATH}"
		region => "${S3_REGION}"
		watch_for_new_files => false
	}
}

output {
	stdout{}    
}

Any help would be appreciated.

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

1 Like

A fix for this was committed about 4 hours ago. I would expect it to be in 8.0.1.

Thankyou all, yes I was installing an output plugin which must have been causing this.

I will pull 8.0.1 when available.

Cheers

Hello,

@Michael_Bailey @sbillo, Another solution is to downgrade the version of Logstash.

In my case, the current logstash version was 7.17, so i downgrade it to 7.15

sudo apt-get install logstash=1:7.15.0-1

Hope it helps!

1 Like

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