logstash-plugins/logstash-output-http

logstash-output-http dependencies break sinatra logstash-mixin-http_client

sbillo opened this issue · 1 comments

Logstash information:

Please include the following information:

  1. Logstash version (e.g. bin/logstash --version)
    logstash 7.17.0

  2. Logstash installation source (e.g. built from source, with a package manager: DEB/RPM, expanded from tar or zip archive, docker)
    apt install logstash

  3. How is Logstash being run (e.g. as a service/service manager: systemd, upstart, etc. Via command line, docker/kubernetes)
    systemctl

  4. How was the Logstash Plugin installed
    /usr/share/logstash/bin/logstash-plugin install logstash-output-http

JVM (e.g. java -version):
openjdk version "11.0.14" 2022-01-18

If the affected version of Logstash is 7.9 (or earlier), or if it is NOT using the bundled JDK or using the 'no-jdk' version in 7.10 (or higher), please provide the following information:

  1. JVM version (java -version)
  2. JVM installation source (e.g. from the Operating System's package manager, from source, etc).
  3. Value of the JAVA_HOME environment variable if set.

OS version (uname -a if on a Unix-like system):
5.15.0-18-generic #18-Ubuntu

Description of the problem including expected versus actual behavior*:

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)
Steps to reproduce:
apt-install logstash
/usr/share/logstash/bin/logstash-plugin install logstash-output-http
systemctl start logstash
journalctl -u logstash -f -n 1000

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

Please include a minimal but complete recreation of the problem,
including (e.g.) pipeline definition(s), settings, locale, etc. The easier
you make for us to reproduce it, the more likely that somebody will take the
time to look at it.

Provide logs (if relevant):