Elasticsearch crashes with every update

Elasticsearch crashes with every update since 8.14.0 and again between 8.17.4 and 8.18.0 with the following error:

java.util.ServiceConfigurationError: Error loading SPI class list from URL: jar:file:///usr/share/elasticsearch/modules/x-pack-security/x-pack-security-8.17.4.jar!/META-INF/services/org.elasticsearch.index.SlowLogFieldProvider
at org.elasticsearch.plugins.spi.SPIClassIterator.loadNextProfile(SPIClassIterator.java:136) ~[elasticsearch-8.17.4.jar:?]

The update is done while Elasticsearch is running and it crashes because a file has disappeared.
Is there a special configuration to put in place to avoid this?

java.nio.file.NoSuchFileException: /usr/share/elasticsearch/modules/x-pack-security/x-pack-security-8.14.2.jar

Have you checked, does this file exist?

Check also the recommendation from github.

This should not be done in this way, the Elasticsearch service needs to be stopped before it is upgraded, this is mentioned in the documentation.

If you added the Elastic repositories for deb or rpm to install it you may disable the repositories so it will not be upgraded when you upgrade other packages in your system.

You may also just remove the repositories and future upgrades will be done by download the rpm or deb package.

You can also lock the package version using the package managers so the upgrades would be ignored.

The main thing is, you cannot upgrade Elasticsearch while it is running, you need to stop it first.

1 Like