Logstash 8.0.0.rc2 with bundled JVM. The add_patterns_from_file function in grok_pure.rb calls file.close in the ensure branch, even if File.new returns nil. This leads to
:exception=>#<NoMethodError: undefined method close' for nil:NilClass>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/jls-grok-0.11.5/lib/grok-pure.rb:83:inadd_patterns_from_file'"`
To reproduce
cd /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-patterns-core-4.3.2/patterns/ecs-v1
touch zzz
chmod 0 zzz
Logstash 8.0.0.rc2 with bundled JVM. The add_patterns_from_file function in grok_pure.rb calls file.close in the ensure branch, even if File.new returns nil. This leads to
To reproduce
and run logstash with
Silently ignoring the unreadable file would be an improvement, but not ideal.