Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipeline_shutdown_requested? not found error with Logstash v7.17.x versions. #1133

Closed
mashhurs opened this issue May 17, 2023 · 2 comments · Fixed by #1134
Closed

pipeline_shutdown_requested? not found error with Logstash v7.17.x versions. #1133

mashhurs opened this issue May 17, 2023 · 2 comments · Fixed by #1134
Assignees

Comments

@mashhurs
Copy link
Contributor

mashhurs commented May 17, 2023

Logstash information:

Please include the following information:

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

  2. Logstash installation source (e.g. built from source, with a package manager: DEB/RPM, expanded from tar or zip archive, docker)
    Downloaded 7.17.10 (Linux X86_64) from Logstash download page

  3. How is Logstash being run (e.g. as a service/service manager: systemd, upstart, etc. Via command line, docker/kubernetes)
    Running via command line: ./bin/logstash -f config/simple.conf and simple.conf uses es-output.

  4. How was the Logstash Plugin installed
    ./bin/logstash-plugin install --version 11.15.4 logstash-output-elasticsearch
    JVM (e.g. java -version):

OS version (uname -a if on a Unix-like system): Ubuntu 22.04

Description of the problem including expected versus actual behavior:
We introduced an expose shutdown to plugin feature in v8.1.1 version and es-output plugin started using this feature from its v11.15.0 versions. When running 11.15.0+ plugin versions with Logstash 7.17.x versions, plugin crashes. Please look at the below error.

Steps to reproduce:

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.

  1. Download Logstash 7.17.10
  2. Install logstash-output-elasticsearch-v11.15.4
  3. Use simple config which uses Elastsearch output plugin and run Logstash with ./bin/logstash -f {your-config-path}

Provide logs (if relevant):

[2023-05-17T14:35:42,009][ERROR][logstash.javapipeline    ][main] Pipeline worker error, the pipeline will be stopped
 {:pipeline_id=>"main", :error=>"(NoMethodError) undefined method `shutdown_requested' for #
<LogStash::JavaPipeline:0x302ed65>", :exception=>Java::OrgJrubyExceptions::NoMethodError, :backtrace=>
["home.ubuntu.logstash_minus_7_dot_17_dot_10.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_output_minus_
elasticsearch_minus_11_dot_15_dot_4_minus_java.lib.logstash.plugin_mixins.elasticsearch.common.pipeline_shutdown_req
uested?(/home/ubuntu/logstash-7.17.10/vendor/bundle/jruby/2.5.0/gems/logstash-output-elasticsearch-11.15.4-
java/lib/logstash/plugin_mixins/elasticsearch/common.rb:380)", 
"home.ubuntu.logstash_minus_7_dot_17_dot_10.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_output_minus_
elasticsearch_minus_11_dot_15_dot_4_minus_java.lib.logstash.outputs.elasticsearch.wait_for_successful_connection(/home
/ubuntu/logstash-7.17.10/vendor/bundle/jruby/2.5.0/gems/logstash-output-elasticsearch-11.15.4-
java/lib/logstash/outputs/elasticsearch.rb:435)", 
"home.ubuntu.logstash_minus_7_dot_17_dot_10.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_output_minus_
elasticsearch_minus_11_dot_15_dot_4_minus_java.lib.logstash.outputs.elasticsearch.multi_receive(/home/ubuntu/logstash-
7.17.10/vendor/bundle/jruby/2.5.0/gems/logstash-output-elasticsearch-11.15.4-
java/lib/logstash/outputs/elasticsearch.rb:385)", 
"org.logstash.config.ir.compiler.OutputStrategyExt$AbstractOutputStrategyExt.multi_receive(org/logstash/config/ir/compiler
/OutputStrategyExt.java:143)", 
"org.logstash.config.ir.compiler.AbstractOutputDelegatorExt.multi_receive(org/logstash/config/ir/compiler/AbstractOutputDe
legatorExt.java:121)", 
"home.ubuntu.logstash_minus_7_dot_17_dot_10.logstash_minus_core.lib.logstash.java_pipeline.start_workers(/home/ubuntu
/logstash-7.17.10/logstash-core/lib/logstash/java_pipeline.rb:300)"], :thread=>"#<Thread:0x14bf827a sleep>"}

@roaksoax
Copy link
Contributor

This issue is because the version that introduced wasn't meant to work in Logstash 7.17, and missed the required minimum dependency on logstash-core where this feature actually landed.

@andsel
Copy link
Contributor

andsel commented May 17, 2023

The error refers to https://github.com/logstash-plugins/logstash-output-elasticsearch/blob/v11.15.4/lib/logstash/plugin_mixins/elasticsearch/common.rb#LL380C38-L380C56

def pipeline_shutdown_requested?
   return super if defined?(super) # since LS 8.1.0
   execution_context&.pipeline&.shutdown_requested
end

In LS < 8.1 the method pipeline_shutdown_requested? doesn't exist so fallback to the implementation

execution_context&.pipeline&.shutdown_requested

but #shutdown_requested doesn't exists in pipeline class, but shutdown_requested?.
So adding the missed ? should fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants