Keystore.tmp error upgrading 1.2.0 to 1.2.1

Hi,
if i try to upgrade docker image from 1.2.0 to 1.2.1 on a data node (upgrade correctly done on 2 clients nodes) i have this error:

Exception in thread "main" org.opensearch.bootstrap.BootstrapException: java.nio.file.FileAlreadyExistsException: /usr/share/opensearch/config/opensearch.keystore.tmp
Likely root cause: java.nio.file.FileAlreadyExistsException: /usr/share/opensearch/config/opensearch.keystore.tmp
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:94)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
        at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:478)
        at java.base/java.nio.file.Files.newOutputStream(Files.java:224)
        at org.apache.lucene.store.FSDirectory$FSIndexOutput.<init>(FSDirectory.java:410)
        at org.apache.lucene.store.FSDirectory$FSIndexOutput.<init>(FSDirectory.java:406)
        at org.apache.lucene.store.FSDirectory.createOutput(FSDirectory.java:254)
        at org.opensearch.common.settings.KeyStoreWrapper.save(KeyStoreWrapper.java:524)
        at org.opensearch.bootstrap.Bootstrap.loadSecureSettings(Bootstrap.java:276)
        at org.opensearch.bootstrap.Bootstrap.init(Bootstrap.java:368)
        at org.opensearch.bootstrap.OpenSearch.init(OpenSearch.java:178)
        at org.opensearch.bootstrap.OpenSearch.execute(OpenSearch.java:169)
        at org.opensearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:100)
        at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138)
        at org.opensearch.cli.Command.main(Command.java:101)
        at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:135)
        at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:101)
Killing performance analyzer process 12
OpenSearch exited with code 1
Performance analyzer exited with code 143

I’m not using docker_compose but chef with docker cookbook (in short is a docker run)

here an extract of mounts of container:

"Binds": [
                "/etc/opensearch/esnode.pem:/usr/share/opensearch/config/esnode.pem",
                "/etc/opensearch/esnode-key.pem:/usr/share/opensearch/config/esnode-key.pem",
                "/etc/opensearch/root-ca.pem:/usr/share/opensearch/config/root-ca.pem",
                "/etc/opensearch/kirk.pem:/usr/share/opensearch/config/kirk.pem",
                "/etc/opensearch/kirk-key.pem:/usr/share/opensearch/config/kirk-key.pem",
                "/etc/opensearch/opensearch.yml:/usr/share/opensearch/config/opensearch.yml",
                "/etc/opensearch/plugin.security_conf.yml:/usr/share/opensearch/plugins/opensearch-security/securityconfig/config.yml",
                "/etc/opensearch/jvm.options:/usr/share/opensearch/config/jvm.options",
                "/mnt/storage/opensearch:/usr/share/opensearch/data"
            ],

If i rollback to 1.2.0 all works

@ynuyasha The provided error reports existence of opensearch.keystore.tmp file. This file will appear during opensearch keystore creation. If already in the /usr/share/opensearch/config/ then opensearch.keystore creation will fail with reported error.

Does your workflow include the creation of the opensearch keystore?

@pablo i have resolved the issue upgrading first master node to 1.2.1. After that i have upgrade data node and error doesn’t appeared anymore.