Task :distribution:run#createKeystore FAILED
Standard output:
Standard error:
Exception in thread "main" java.lang.IllegalStateException: unable to read from standard input; is standard input open and a tty attached?
at org.elasticsearch.cli.Terminal$SystemTerminal.readText(Terminal.java:173)
at org.elasticsearch.cli.Terminal.promptYesNo(Terminal.java:106)
at org.elasticsearch.common.settings.CreateKeyStoreCommand.execute(CreateKeyStoreCommand.java:43)
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:77)
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:40)
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':distribution:run#createKeystore'.
Process 'cmd [/C, call, C:\Users\Mohan Kumar U\Desktop\elasticsearch-master\distribution\build\cluster\run node0\elasticsearch-8.0.0-SNAPSHOT\bin\elasticsearch-keystore, create]' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See Command-Line Interface
I just tried the latest master branch on my laptop and this worked well. But I'm running under MacOS. @jasontedor do we have anyone who can test that on a windows machine?
Once you get the error, could you go to C:\Users\Mohan Kumar U\Desktop\elasticsearch-master\distribution\build\cluster\run node0\elasticsearch-8.0.0-SNAPSHOT\bin dir and run from the prompt:
In thisC:\Users\Mohan Kumar U\Desktop\elasticsearch-master\distribution\build\cluster\run node0\elasticsearch-8.0.0-SNAPSHOT\ dir, i got 'elasticsearch-keystore' is not recognized as an internal or external command, operable program or batch file.
In C:\Users\Mohan Kumar U\Desktop\elasticsearch-master\distribution\build\cluster\run node0\elasticsearch-8.0.0-SNAPSHOT\bin` dir, I got thisAn elasticsearch keystore already exists. Overwrite? [y/N]y
Exception in thread "main" java.nio.file.AccessDeniedException: C:\ProgramData\Elastic\Elasticsearch\config\elasticsearch.keystore.tmp -> C:\ProgramData\Elastic\Elasticsearch\config\elasticsearch.keystore
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:309)
at java.base/sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:288)
at java.base/java.nio.file.Files.move(Files.java:1421)
at org.elasticsearch.common.settings.KeyStoreWrapper.save(KeyStoreWrapper.java:505)
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:77)
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:40)
This was expected as the user was in the wrong directory and there was no elasticsearch-keystore in there.
The error here is that the user that ran the elasticsearch-keystore command doesn't have the necessary permissions to overwrite the existing elasticsearch.keystore file during our attempt to overwrite the file. Which might make sense since the file is located in C:\ProgramData\Elastic\Elasticsearch\config\elasticsearch.keystore
This seems to imply that the keystore was already created despite the error message shown in the original post.
@MKU can you please delete the folder and download the latest version again and try to run ./gradlew run? I don't have a windows machine available right now but I can try to replicate this in a VM later if need be
I guess that if they run gradlew clean with the same user that runs gradlew run then the user would not have the permissions to remove the existing keystore.
The original error
implies that the keystore was already there when this gradle run ran, as it fails when it tries to offer a prompt to the user telling them that the keystore already exists and they can overwrite it if they want to.
An interesting question is why does the user get
In C:\Users\Mohan Kumar U\Desktop\elasticsearch-master\distribution\build\cluster\run node0\elasticsearch-8.0.0-SNAPSHOT\bin` dir, I got thisAn elasticsearch keystore already exists. Overwrite? [y/N]y
Exception in thread "main" java.nio.file.AccessDeniedException: C:\ProgramData\Elastic\Elasticsearch\config\elasticsearch.keystore.tmp -> C:\ProgramData\Elastic\Elasticsearch\config\elasticsearch.keystore
which seems to imply that $ES_CONFIG env variable exists and points to C:\ProgramData\Elastic\Elasticsearch\config\ and is picked up by ./gradlew run
@MKU is Elasticsearch already installed in this windows machine ? If so how did you install it?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.