Unfortunately for this situation, we moved away from using ES as a fork since CrateDB 4.0.0 (we integrated required parts into our code base). Thus, using any ES code independent isn’t working anymore. You could try to include all CrateDB and Lucene JAR files located at <CRATE-INSTALL>/lib
into the class path of the elasticsearch-cli
script which the elasticsearch-shard
tool is using (see elasticsearch/distribution/src/bin/elasticsearch-shard at v8.12.2 · elastic/elasticsearch · GitHub and elasticsearch/distribution/src/bin/elasticsearch-cli at v8.12.2 · elastic/elasticsearch · GitHub.
This would load the required lucene libraries.
Also ensure that you are invoking it with the same Java version the related CrateDB version uses. For CrateDB 5.6.5 use Java 21, see crate/pom.xml at 5.6.5 · crate/crate · GitHub.
Another solution would be (that’s what the elasticsearch-shard
CLI is actually doing) to remove the files which are corrupted manually while the CrateDB instance isn’t running.
Of course both ways will result in a data loss.