Cannot launch elasticsearch, Exception in thread "main" java.security.spec.InvalidKeySpecException: Could not generate secret key

Prior to executing ./elasticsearch, I attempt to create a keystore, but get the below error

/elasticsearch-keystore create
Exception in thread "main" java.security.spec.InvalidKeySpecException: Could not generate secret key
at javax.crypto.SecretKeyFactory.generateSecret(Unknown Source)
at org.elasticsearch.common.settings.KeyStoreWrapper.createCipher(KeyStoreWrapper.java:289)
at org.elasticsearch.common.settings.KeyStoreWrapper.encrypt(KeyStoreWrapper.java:361)
at org.elasticsearch.common.settings.KeyStoreWrapper.save(KeyStoreWrapper.java:473)
at org.elasticsearch.common.settings.CreateKeyStoreCommand.execute(CreateKeyStoreCommand.java:58)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:79)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.common.settings.KeyStoreCli.main(KeyStoreCli.java:41)
Caused by: java.lang.RuntimeException: Error deriving PBKDF2 keys
at com.ibm.crypto.provider.PBKDF2KeyImpl.a(Unknown Source)
at com.ibm.crypto.provider.PBKDF2KeyImpl.(Unknown Source)
at com.ibm.crypto.provider.bm.engineGenerateSecret(Unknown Source)
... 11 more

What is the issue?

I am exporting my Java variable to the OpenJDK 10 and operating on the OpenJDK

openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment 18.3 (build 10.0.2+13)
OpenJDK 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)

/elasticsearch -version
Version: 6.3.2, Build: default/zip/053779d/2018-07-20T05:20:23.451332Z, JVM: 1.8.0_161

Are you sure you are not using an IBM jdk? Both your stack trace, and some googling indicate this is a problem with that. We currently use an empty passphrase in the keystore. Note that starting in 6.4.0, the keystore implementation has been reworked so it no longer uses PBKDF2, so this would go away. But Elastic still does not officially support running on IBM's java.

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