ROR plugin for ES 8.x - Patch error

Hi,

I installed Elasticsearch 8.1.1 but not with the RPM of the editor. I used the tar.gz file.

When I want to path the ROR plugin, I get the following error :
jdk/bin/java -jar plugins/readonlyrest/ror-tools.jar patch
Exception in thread “main” java.nio.file.NoSuchFileException: /usr/share/elasticsearch/plugins /readonlyrest

But my Elasticsearch is not installed in the /usr/share folder.

Regards
H.

Hi @hassen

The es-path can be changed.

> java -jar ror-tools.jar --help
ROR tools 1.0.0
Usage: java -jar ror-tools.jar [patch|unpatch|verify] [options]

Command: patch [options]
patch is a command that modifies ES installation for ROR purposes
  --es-path <value>        Path to elasticsearch directory; default=/usr/share/elasticsearch

Command: unpatch [options]
unpatch is a command that reverts modifications done by patching
  --es-path <value>        Path to elasticsearch directory; default=/usr/share/elasticsearch

Command: verify [options]
verify is a command that verifies if ES installation is patched
  --es-path <value>        Path to elasticsearch directory; default=/usr/share/elasticsearch

  -h, --help               prints this usage text

I think that everything should be obvious to you at the moment.
In case of any other problem with the patching, let us know about it.

–es-path not working on Windows? Any advice? Thanks

I am getting below error even when running --help only.
Caused by: java.lang.IllegalArgumentException: requirement failed: \usr\share\elasticsearch is not an absolute path

1 Like

TBH we didn’t test it on windows. Could you please show us the error you get?

Good point. We should test on windows, and add some copy paste examples in the docs as well!

Hi! Not sure if I should start a new thread, or piggy back from here. Related to the patch and \usr\share\elasticsearch is not an absolute path problem.

First off - runing on Windows. Currently trying ES 8.3.3, ROR-ES 1.42.0
I’ve been running some variant of ES 7 with ROR before with no problems, so that means that it is something added with ROR for ES 8.

So… The instruction says to patch the patch

–es-path /my/custom/path/to/es/folder

if the ES is installed elswere. BUT. The problem is, that the tool itself does not start, looks like we don’t get to the part where the --es-path can come in to play.

jdk/bin/java -jar ./plugins/readonlyrest/ror-tools.jar patch --es-path “C:/my/path”

Exception in thread “main” java.lang.ExceptionInInitializerError
at tech.beshu.ror.tools.RorToolsApp$.esPathOption$lzycompute(RorToolsApp.scala:101)
at tech.beshu.ror.tools.RorToolsApp$.esPathOption(RorToolsApp.scala:99)
at tech.beshu.ror.tools.RorToolsApp$.patchCommand$lzycompute(RorToolsApp.scala:77)
at tech.beshu.ror.tools.RorToolsApp$.patchCommand(RorToolsApp.scala:72)
at tech.beshu.ror.tools.RorToolsApp$.parser$lzycompute(RorToolsApp.scala:63)
at tech.beshu.ror.tools.RorToolsApp$.parser(RorToolsApp.scala:60)
at tech.beshu.ror.tools.RorToolsApp$.main(RorToolsApp.scala:30)
at tech.beshu.ror.tools.RorToolsApp.main(RorToolsApp.scala)
Caused by: java.lang.IllegalArgumentException: requirement failed: \usr\share\elasticsearch is not an absolute path
at tech.beshu.ror.tools.scala.Predef$.require(Predef.scala:281)
at tech.beshu.ror.tools.os.Path.(Path.scala:446)
at tech.beshu.ror.tools.os.Path$.apply(Path.scala:398)
at tech.beshu.ror.tools.tech.beshu.ror.tools.core.utils.EsDirectory$.(EsDirectory.scala:27)
at tech.beshu.ror.tools.tech.beshu.ror.tools.core.utils.EsDirectory$.(EsDirectory.scala)

Even when I try to start

jdk/bin/java -jar plugins/readonlyrest/ror-tools.jar --help

The tool results with the same error:

Exception in thread “main” java.lang.ExceptionInInitializerError
at tech.beshu.ror.tools.RorToolsApp$.esPathOption$lzycompute(RorToolsApp.scala:101)
at tech.beshu.ror.tools.RorToolsApp$.esPathOption(RorToolsApp.scala:99)
at tech.beshu.ror.tools.RorToolsApp$.patchCommand$lzycompute(RorToolsApp.scala:77)
at tech.beshu.ror.tools.RorToolsApp$.patchCommand(RorToolsApp.scala:72)
at tech.beshu.ror.tools.RorToolsApp$.parser$lzycompute(RorToolsApp.scala:63)
at tech.beshu.ror.tools.RorToolsApp$.parser(RorToolsApp.scala:60)
at tech.beshu.ror.tools.RorToolsApp$.main(RorToolsApp.scala:30)
at tech.beshu.ror.tools.RorToolsApp.main(RorToolsApp.scala)
Caused by: java.lang.IllegalArgumentException: requirement failed: \usr\share\elasticsearch is not an absolute path
at tech.beshu.ror.tools.scala.Predef$.require(Predef.scala:281)
at tech.beshu.ror.tools.os.Path.(Path.scala:446)
at tech.beshu.ror.tools.os.Path$.apply(Path.scala:398)
at tech.beshu.ror.tools.tech.beshu.ror.tools.core.utils.EsDirectory$.(EsDirectory.scala:27)
at tech.beshu.ror.tools.tech.beshu.ror.tools.core.utils.EsDirectory$.(EsDirectory.scala)
… 8 more

Is there any environment variable or java variable I can change so that the --es-path takes into effect before running the patch tool ?

I’m not too familiar with Java/Scala and os.Path specifics on Windows, but my guess is, that the problem is somewhere between these two lines:

elasticsearch-readonlyrest-plugin/RorToolsApp.scala at db20213384b14dc2b913d4f4ed96e769f4303edc · sscarduzio/elasticsearch-readonlyrest-plugin · GitHub

elasticsearch-readonlyrest-plugin/EsDirectory.scala at db20213384b14dc2b913d4f4ed96e769f4303edc · sscarduzio/elasticsearch-readonlyrest-plugin · GitHub

It looks like we have a problem with ror-tools on Windows. Will check it and let you know here

Can confirm, at this point it’s not possible to use RoR on Windows at all.

A fix is on the way, and will be available next week as we release a new version of ROR.

Hi all,

ROR 1.43.0 is released and this bug is fixed. Please test and let us know

1 Like