We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description of the problem including expected versus actual behavior: Constant error on no multipart message regarding not having attachments variable present. In the case the IF on https://github.com/logstash-plugins/logstash-input-imap/blob/master/lib/logstash/inputs/imap.rb#L170 is true then the variable attachments does not get set. Which is causing the error on https://github.com/logstash-plugins/logstash-input-imap/blob/master/lib/logstash/inputs/imap.rb#L213.
attachments
true
Steps to reproduce:
Provide logs (if relevant): 2021-10-26T22:47:02,514][ERROR][logstash.inputs.imap ][xxx][0a07994cad85ba5ba7c29ee42c2cf8e414ed38435024a0cf3934c6b003696e6e] Encountered error NameError {:message=>"undefined local variable or method attachments' for #<LogStash::Inputs::IMAP:0x18e7c547>", :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:219:in block in parse_mail'", "/usr/share/logstash/logstash-core/lib/logstash/codecs/delegator.rb:64:in block in decode'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-codec-plain-3.0.6/lib/logstash/codecs/plain.rb:35:in decode'", "/usr/share/logstash/logstash-core/lib/logstash/codecs/delegator.rb:62:in block in decode'", "org/logstash/instrument/metrics/AbstractSimpleMetricExt.java:65:in time'", "org/logstash/instrument/metrics/AbstractNamespacedMetricExt.java:64:in time'", "/usr/share/logstash/logstash-core/lib/logstash/codecs/delegator.rb:61:in decode'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:183:in parse_mail'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:119:in block in check_mail'", "org/jruby/RubyArray.java:1809:in each'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:113:in block in check_mail'", "org/jruby/RubyArray.java:1851:in each_slice'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:111:in check_mail'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:92:in block in run'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/stud-0.0.23/lib/stud/interval.rb:20:in interval'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:91:in run'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:405:in inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:396:in `block in start_input'"]}
attachments' for #<LogStash::Inputs::IMAP:0x18e7c547>", :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:219:in
block in decode'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-codec-plain-3.0.6/lib/logstash/codecs/plain.rb:35:in
block in decode'", "org/logstash/instrument/metrics/AbstractSimpleMetricExt.java:65:in
time'", "/usr/share/logstash/logstash-core/lib/logstash/codecs/delegator.rb:61:in
parse_mail'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:119:in
each'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:113:in
each_slice'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:111:in
block in run'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/stud-0.0.23/lib/stud/interval.rb:20:in
run'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:405:in
Possible workaround I got it working changing https://github.com/logstash-plugins/logstash-input-imap/blob/master/lib/logstash/inputs/imap.rb#L213 to if defined?(attachments) && attachments.length > 0. But bear in mind: I really do NOT know ruby at all so this might not be the "correct" way to fix it.
if defined?(attachments) && attachments.length > 0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description of the problem including expected versus actual behavior:
Constant error on no multipart message regarding not having
attachments
variable present. In the case the IF on https://github.com/logstash-plugins/logstash-input-imap/blob/master/lib/logstash/inputs/imap.rb#L170 istrue
then the variableattachments
does not get set. Which is causing the error on https://github.com/logstash-plugins/logstash-input-imap/blob/master/lib/logstash/inputs/imap.rb#L213.Steps to reproduce:
Provide logs (if relevant):
2021-10-26T22:47:02,514][ERROR][logstash.inputs.imap ][xxx][0a07994cad85ba5ba7c29ee42c2cf8e414ed38435024a0cf3934c6b003696e6e] Encountered error NameError {:message=>"undefined local variable or method
attachments' for #<LogStash::Inputs::IMAP:0x18e7c547>", :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:219:in
block in parse_mail'", "/usr/share/logstash/logstash-core/lib/logstash/codecs/delegator.rb:64:inblock in decode'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-codec-plain-3.0.6/lib/logstash/codecs/plain.rb:35:in
decode'", "/usr/share/logstash/logstash-core/lib/logstash/codecs/delegator.rb:62:inblock in decode'", "org/logstash/instrument/metrics/AbstractSimpleMetricExt.java:65:in
time'", "org/logstash/instrument/metrics/AbstractNamespacedMetricExt.java:64:intime'", "/usr/share/logstash/logstash-core/lib/logstash/codecs/delegator.rb:61:in
decode'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:183:inparse_mail'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:119:in
block in check_mail'", "org/jruby/RubyArray.java:1809:ineach'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:113:in
block in check_mail'", "org/jruby/RubyArray.java:1851:ineach_slice'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:111:in
check_mail'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:92:inblock in run'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/stud-0.0.23/lib/stud/interval.rb:20:in
interval'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.1.0/lib/logstash/inputs/imap.rb:91:inrun'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:405:in
inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:396:in `block in start_input'"]}Possible workaround
I got it working changing https://github.com/logstash-plugins/logstash-input-imap/blob/master/lib/logstash/inputs/imap.rb#L213 to
if defined?(attachments) && attachments.length > 0
. But bear in mind: I really do NOT know ruby at all so this might not be the "correct" way to fix it.The text was updated successfully, but these errors were encountered: