Skip to content
New issue

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

keystore loading regression since 7.11 #12783

Closed
kares opened this issue Mar 30, 2021 · 0 comments · Fixed by #12784
Closed

keystore loading regression since 7.11 #12783

kares opened this issue Mar 30, 2021 · 0 comments · Fixed by #12784

Comments

@kares
Copy link
Contributor

kares commented Mar 30, 2021

bin/logstash-keystore list is failing with:

Using JAVA_HOME defined java: /opt/java/jdk
WARNING, using JAVA_HOME while Logstash distribution comes with a bundled JDK
ERROR: Failed to load settings file from "path.settings". Aborting... path.setting=/home/kares/workspace/work/elastic/logstash-7.12.0/config, exception=NameError, message=>uninitialized constant LogStash::Util::Password

[ERROR] 2021-03-30 10:53:09.854 [main] secretstorecli - Can not find Logstash keystore at /home/kares/workspace/work/elastic/logstash-7.12.0/config/logstash.keystore. Please verify this file exists and is a valid Logstash keystore. {:cause=>nil, :backtrace=>["org.logstash.secret.store.backend.JavaKeyStore.load(org/logstash/secret/store/backend/JavaKeyStore.java:269)", "org.logstash.secret.store.backend.JavaKeyStore.load(org/logstash/secret/store/backend/JavaKeyStore.java:59)", "org.logstash.secret.store.SecretStoreFactory.doIt(org/logstash/secret/store/SecretStoreFactory.java:129)", "org.logstash.secret.store.SecretStoreFactory.load(org/logstash/secret/store/SecretStoreFactory.java:115)", "org.logstash.secret.cli.SecretStoreCli.command(org/logstash/secret/cli/SecretStoreCli.java:97)", "java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)", "org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:426)", "org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:293)", "home.kares.workspace.work.elastic.logstash_minus_7_dot_12_dot_0.lib.secretstore.cli.<module:SecretStoreCli>(/home/kares/workspace/work/elastic/logstash-7.12.0/lib/secretstore/cli.rb:52)", "home.kares.workspace.work.elastic.logstash_minus_7_dot_12_dot_0.lib.secretstore.cli.<main>(/home/kares/workspace/work/elastic/logstash-7.12.0/lib/secretstore/cli.rb:33)", "java.lang.invoke.MethodHandle.invokeWithArguments(java/lang/invoke/MethodHandle.java:627)", "org.jruby.Ruby.runScript(org/jruby/Ruby.java:1205)", "org.jruby.Ruby.runNormally(org/jruby/Ruby.java:1128)", "org.jruby.Ruby.runNormally(org/jruby/Ruby.java:1146)", "org.jruby.Ruby.runFromMain(org/jruby/Ruby.java:958)", "org.jruby.Main.doRunFromMain(org/jruby/Main.java:412)", "org.jruby.Main.internalRun(org/jruby/Main.java:304)", "org.jruby.Main.run(org/jruby/Main.java:234)", "org.jruby.Main.main(org/jruby/Main.java:206)"]}

or here's a "better" (plain) Ruby trace:

2021-03-30T10:19:44.718+02:00 [main] INFO TraceType : Exception raised: NameError : uninitialized constant LogStash::Util::Password
2021-03-30T10:19:44.719+02:00 [main] INFO TraceType : Backtrace generated:
            const_missing at org/jruby/RubyModule.java:3760
     replace_placeholders at /home/kares/workspace/work/elastic/logstash/logstash-core/lib/logstash/util/substitution_variables.rb:53
             deep_replace at /home/kares/workspace/work/elastic/logstash/logstash-core/lib/logstash/util/substitution_variables.rb:43
             deep_replace at /home/kares/workspace/work/elastic/logstash/logstash-core/lib/logstash/util/substitution_variables.rb:35
                     each at org/jruby/RubyHash.java:1415
             deep_replace at /home/kares/workspace/work/elastic/logstash/logstash-core/lib/logstash/util/substitution_variables.rb:34
                from_yaml at /home/kares/workspace/work/elastic/logstash/logstash-core/lib/logstash/settings.rb:179
                from_yaml at /home/kares/workspace/work/elastic/logstash/logstash-core/lib/logstash/util/settings_helper.rb:55
  <module:SecretStoreCli> at /home/kares/workspace/work/elastic/logstash/lib/secretstore/cli.rb:48
                   <main> at /home/kares/workspace/work/elastic/logstash/lib/secretstore/cli.rb:33

in 7.11 the LS::Util::Password was moved to Java along with other parts that dropped require 'logstash/util/password'
this revealed a bug where logstash/util/substitution_variables.rb forgot to require it's dependency: LogStash::Util::Password

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant