# Logstash-keystore permission denied

**URL:** <https://discuss.elastic.co/t/logstash-keystore-permission-denied/309426>\
**Category:** Logstash\
**Created:** [July 12, 2022, 1:38pm UTC](https://discuss.elastic.co/t/logstash-keystore-permission-denied/309426 "2022-07-12T13:38:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christer\_Palmen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christer_palmen/32/76857_2.png) [@Christer\_Palmen](https://discuss.elastic.co/u/Christer_Palmen)\
**Post date:** [July 12, 2022, 1:38pm UTC](https://discuss.elastic.co/t/logstash-keystore-permission-denied/309426/1 "2022-07-12T13:38:09Z")

</div>

```auto
`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?

```

---

<div class="post-metadata">

**Author:** ![volvo745rules](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/volvo745rules/32/98880_2.png) [@volvo745rules](https://discuss.elastic.co/u/volvo745rules)\
**Post date:** [July 29, 2022, 9:47am UTC](https://discuss.elastic.co/t/logstash-keystore-permission-denied/309426/2 "2022-07-29T09:47:07Z")

</div>

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](https://www.elastic.co/guide/en/logstash/current/ts-logstash.html), but it didn't help.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 29, 2022, 1:03pm UTC](https://discuss.elastic.co/t/logstash-keystore-permission-denied/309426/3 "2022-07-29T13:03:13Z")

</div>

> [@volvo745rules](#):
>
> Initially I tried to add -Djdk.io.File.enableADS=true to jvm.options , which is mentioned in the [TS guide](https://www.elastic.co/guide/en/logstash/current/ts-logstash.html), but it didn't help.

The batch scripts do not read jvm.options. See [this](https://discuss.elastic.co/t/unable-to-run-logstash-8-3-1-not-even-to-check-plugins-errno-permission-denied-nul/308871/4) thread. Follow the link to the github issue for additional details on the solution.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 26, 2022, 1:04pm UTC](https://discuss.elastic.co/t/logstash-keystore-permission-denied/309426/4 "2022-08-26T13:04:03Z")

</div>

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