Description
Elasticsearch version: Pertains to 7.4.x and up
Plugins installed: []
JVM version (java -version
): Pertains to 12 and up
OS version (uname -a
if on a Unix-like system): Ubuntu 19.04, 20.04
Description of the problem including expected versus actual behavior:
I'm developing a plugin that started with ES version 7.4.x and I want to update it to use the latest 7.7.x. I found that after bumping from 7.4.2 to 7.5.0 I'm no longer able to debug the plugin using ./gradlew run --debug-jvm
. The regular ./gradlew run
still works like normal.
Steps to reproduce:
I was able to replicate this with an open source plugin maintained by an elastic employee: https://github.com/spinscale/elasticsearch-ingest-langdetect, which I'll use for my example below.
If you checkout the commit that updates to 7.4.2, you'll find you can run ./gradlew run --debug-jvm
without issue.
$ git checkout 3b533ee8bd50c72b242629e2606f73edeb1ddbf6
$ ./gradlew run --debug-jvm
This eventually prints "Running elasticsearch in debug mode, suspending until connected on port 8000" and you can connect from an IDE. So it works.
Then if you checkout the next commit that updates to 7.5.0, and run with --stacktrace
, you get an error.
$ git checkout 28c4c8851cb0d00945286f8c02327ebd00995b09
$ ./gradlew --stacktrace run --debug-jvm
This eventually prints a large stacktrace, summarized below:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':run'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:166)
...
...
Caused by: org.gradle.process.internal.ExecException: Process 'command './bin/elasticsearch-plugin'' finished with non-zero exit value 2
at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:409)
...
I also tried this with the subsequent 7.6.x and 7.7.x updates and it produces the same errors.
Note that both 7.4.2 and 7.5.0 are running on JDK 12. So it doesn't seem to be a JDK bug.
I'm using OpenJDK 12.0.2 in the above example.
Provide logs (if relevant):
Here is the full log: https://pastebin.com/6RctUHpL