-
Bug Report
-
Resolution: Fixed
-
L3 - Default
-
7.16.0
Environment (Required on creation):
The Camunda Docker image using the Camunda Tomcat distro.
Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):
When setting the JMX_PROMETHEUS flag to true, any user-defined CATALINA_OPTS content is overwritten.
Steps to reproduce (Required on creation):
Execute: docker run -e CATALINA_OPTS=-Dcom.sun.management.jmxremote=true -e JMX_PROMETHEUS=true camunda-bpm-platform:tomcat-latest
Observed Behavior (Required on creation):
The user-defined CATALINA_OPTS content (e.g. theĀ -Dcom.sun.management.jmxremote=true flag) is not passed to Apache Tomcat. See the logs below:
16-Mar-2022 11:38:08.540 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 16-Mar-2022 11:38:08.541 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -javaagent:/camunda/javaagent/jmx_prometheus_javaagent.jar=9404:/camunda/javaagent/prometheus-jmx.yml
Expected behavior (Required on creation):
Any user-defined CATALINA_OPTS content (e.g. theĀ -Dcom.sun.management.jmxremote=true flag) is passed to Apache Tomcat. See the logs below:
16-Mar-2022 11:38:08.540 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
16-Mar-2022 11:38:08.541 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=true
16-Mar-2022 11:38:08.541 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -javaagent:/camunda/javaagent/jmx_prometheus_javaagent.jar=9404:/camunda/javaagent/prometheus-jmx.yml
Root Cause (Required on prioritization):
When JMX_PROMETHEUS is set to true, the CATALINA_OPTS flag is overwritten here: https://github.com/camunda/docker-camunda-bpm-platform/blob/next/camunda-tomcat.sh#L56
Solution Ideas (Optional):
Previous CATALINA_OPTS content should be included, like with the Wildfly distro: https://github.com/camunda/docker-camunda-bpm-platform/blob/next/camunda-wildfly.sh#L80