Logstash-keystore permission denied

`Hello.
I´m going to install ELK for an  customer, and as a start I´m setting up an test ELK with version 8.3.2 to see how it works.
I am using Windows10 as the host for ELK
As a start I have setup the Elasticsearch and Kibana with security enabled, but now when I´m trying to setup Logstash with logstash-keystore create command, I get this error message:
PS C:\Elastic\logstash\bin> .\logstash-keystore create
"Using bundled JDK: C:\Elastic\logstash\jdk\bin\java.exe"
Errno::EACCES: Permission denied - NUL
                    sysopen at org/jruby/RubyIO.java:1237
                 initialize at org/jruby/RubyFile.java:365
                       open at org/jruby/RubyIO.java:1156
                 initialize at C:/Elastic/logstash/vendor/jruby/lib/ruby/stdlib/rubygems/user_interaction.rb:645
                 initialize at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/ui/rg_proxy.rb:11
                        ui= at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler.rb:91
                         ui at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler.rb:87
                   validate at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/rubygems_integration.rb:68
              validate_spec at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/source/path.rb:168
            load_spec_files at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/source/path.rb:182
                       each at org/jruby/RubyArray.java:1821
            load_spec_files at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/source/path.rb:176
                local_specs at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/source/path.rb:107
                      specs at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/source/path.rb:115
  specs_for_source_changed? at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/definition.rb:562
             specs_changed? at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/definition.rb:547
             converge_paths at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/definition.rb:591
                       any? at org/jruby/RubyArray.java:4553
             converge_paths at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/definition.rb:590
                 initialize at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/definition.rb:134
              to_definition at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/dsl.rb:219
                   evaluate at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/dsl.rb:13
                      build at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler/definition.rb:38
                 definition at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler.rb:208
                      setup at C:/Elastic/logstash/vendor/bundle/jruby/2.5.0/gems/bundler-2.3.17/lib/bundler.rb:156
                     setup! at C:/Elastic/logstash/lib/bootstrap/bundler.rb:83
                     <main> at C:\Elastic\logstash\lib\secretstore\cli.rb:20.

I have done some troubleshooting, and I have configured -Djdk.io.File.enableADS=true in the jvm.options file, but it does not help.
Anyone else who has seen this issue, and if yes...Any solutions?
1 Like

I solved a similar issue by using the elasticsearch jdk instead of the logstash jdk.
Elasicsearch and logstash use different versions:
D:>D:\apps\elk\8.3.2\logstash\jdk\bin\java.exe -version
openjdk version "11.0.15" 2022-04-19
OpenJDK Runtime Environment Temurin-11.0.15+10 (build 11.0.15+10)
OpenJDK 64-Bit Server VM Temurin-11.0.15+10 (build 11.0.15+10, mixed mode)

D:>D:\apps\elk\8.3.2\elasticsearch\jdk\bin\java.exe -version
openjdk version "18.0.1.1" 2022-04-22
OpenJDK Runtime Environment (build 18.0.1.1+2-6)
OpenJDK 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)

Add to logstash-keystore.bat:
set LS_JAVA_HOME=D:\apps\elk\8.3.2\elasticsearch\jdk

Now I was able to create the logstash keystore and add keys.

Initially I tried to add -Djdk.io.File.enableADS=true to jvm.options , which is mentioned in the TS guide, but it didn't help.

The batch scripts do not read jvm.options. See this thread. Follow the link to the github issue for additional details on the solution.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.