Logstash (EACCESS) 权限被拒绝

Logstash (EACCESS) Permission Denied

我的 logstash 实例已停止工作并出现权限被拒绝错误。我 运行 正在 Windows。我一直在使用 7.8.1 版,也尝试过 7.16.2 版。两者return同样的错误。我是 运行ning 作为管理员。 Windows cmd 和 git bash shell 中的相同错误。当我尝试 运行 不同 logstash 配置文件上的命令时出现同样的错误。

我的命令:logstash -tf logstash-sample.conf

v7.16.2 的错误消息和堆栈跟踪:

Using JAVA_HOME defined java: C:\Program Files\Java\jdk1.8.0_331
WARNING: Using JAVA_HOME while Logstash distribution comes with a bundled JDK.
DEPRECATION: The use of JAVA_HOME is now deprecated and will be removed starting from 8.0. Please configure LS_JAVA_HOME instead.
[FATAL] 2022-05-02 18:08:05.960 [main] Logstash - Logstash stopped processing because of an error: (EACCES) Permission denied - NUL
org.jruby.exceptions.SystemCallError: (EACCES) Permission denied - NUL
        at org.jruby.RubyIO.sysopen(org/jruby/RubyIO.java:1237) ~[jruby-complete-9.2.20.1.jar:?]
        at org.jruby.RubyFile.initialize(org/jruby/RubyFile.java:365) ~[jruby-complete-9.2.20.1.jar:?]
        at org.jruby.RubyIO.open(org/jruby/RubyIO.java:1156) ~[jruby-complete-9.2.20.1.jar:?]
        at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.rubygems.user_interaction.initialize(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/user_interaction.rb:645) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.ui.rg_proxy.initialize(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/ui/rg_proxy.rb:11) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.ui=(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler.rb:90) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.ui(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler.rb:86) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.rubygems_integration.validate(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/rubygems_integration.rb:72) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.source.path.validate_spec(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/source/path.rb:168) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.source.path.load_spec_files(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/source/path.rb:182) ~[?:?]
        at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1821) ~[jruby-complete-9.2.20.1.jar:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.source.path.load_spec_files(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/source/path.rb:176) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.source.path.local_specs(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/source/path.rb:107) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.source.path.specs(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/source/path.rb:115) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.definition.specs_for_source_changed?(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/definition.rb:557) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.definition.specs_changed?(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/definition.rb:542) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.definition.converge_paths(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/definition.rb:586) ~[?:?]
        at org.jruby.RubyArray.any?(org/jruby/RubyArray.java:4553) ~[jruby-complete-9.2.20.1.jar:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.definition.converge_paths(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/definition.rb:585) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.definition.initialize(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/definition.rb:128) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.dsl.to_definition(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/dsl.rb:221) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.dsl.evaluate(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/dsl.rb:13) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.definition.build(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler/definition.rb:33) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.definition(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler.rb:196) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.vendor.bundle.jruby._dot_5_dot_0.gems.bundler_minus_2_dot_2_dot_33.lib.bundler.setup(C:/apps/logstash/logstash-7.16.2/vendor/bundle/jruby/2.5.0/gems/bundler-2.2.33/lib/bundler.rb:144) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.lib.bootstrap.bundler.setup!(C:/apps/logstash/logstash-7.16.2/lib/bootstrap/bundler.rb:79) ~[?:?]
        at C_3a_.apps.logstash.logstash_minus_7_dot_16_dot_2.lib.bootstrap.environment.<main>(C:\apps\logstash\logstash-7.16.2\lib\bootstrap\environment.rb:89) ~[?:?]

我不确定如何解决权限问题。关于根本原因有什么想法吗?

我遇到了类似的问题,但如果我尝试使用 2022 年 2 月左右发布的旧版 JDK,我的问题就可以解决。

这是一个open issue in logstash. The underlying Java issue is here。您可以通过将 -Djdk.io.File.enableADS=true 添加到 JVM 选项使其与当前的 JVM 一起工作。