logstash-plugins / logstash-integration-jdbc

Logstash Integration Plugin for JDBC, including Logstash Input and Filter Plugins
Apache License 2.0
53 stars 55 forks source link

Build fails with docker images for Logstash 8.15+ #173

Closed yaauie closed 2 months ago

yaauie commented 2 months ago

Because building this plugin requires building Derby, and because building Derby invokes the Java Security Manager, builds fail when using the logstash-plugins/.ci docker images that have Java 21.

#17 79.16 * What went wrong:
#17 79.16 Execution failed for task ':buildDerby'.
#17 79.16 > The following error occurred while executing this line:
#17 79.16   /usr/share/plugins/plugin/build/10.15/build.xml:848: java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
#17 79.16 
#17 79.16 * Try:
#17 79.16 > Run with --stacktrace option to get the stack trace.
#17 79.16 > Run with --info or --debug option to get more log output.
#17 79.16 > Run with --scan to get full insights.
#17 79.16 > Get more help at https://help.gradle.org3 actionable tasks: 3 executed
#17 79.17 .
#17 79.17 
#17 79.17 BUILD FAILED in 1m 16s

The message is a little confusing because we wouldn't expect a warning of a future removal to throw an exception, but it is technically accurate: the API's are not actually removed (yet).

In Java 17+, the java.security.manager system property (allow or disallow) controls whether the dynamic security manager settings can be used, and in Java 18+ the default value when unset was changed to be disallow.

Because this failure is in the build-chain where multiple JVMs are spawned, we will need to hunt down the particular place to ensure the system property is set appropriately.

WORKAROUND

Build with Logstash 8.14.2: ELASTIC_STACK_VERSION=8.14.2