Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-11986

Bundled Elasticsearch Windows Service default settings incompatible with Java 11

    XMLWordPrintable

Details

    Description

      Summary

      When the Windows Service for the bundled Elasticsearch instance is created by the Bitbucket Windows installer, the default Java options prevent the Elasticsearch service from starting.

      Steps to Reproduce

      1. Install AdoptOpenJDK11 or an equivalent distribution of Java 11, and set the JAVA_HOME and JRE_HOME environment variables to this installed JDK
      2. Run the Bitbucket installer, select Install Bitbucket Server, and opt to create the Windows Services.
        • The Elasticsearch instance then needs to be manually pointed to use the JDK11 instance - see BSERV-11985
      3. After install completes, open the settings of the Elasticsearch Windows service
      4. On the Java tab, change the JVM to the Java 11 instance that was installed in step 1

      Expected Results

      Either the Elasticsearch service works when manually switched to JDK11, or the installer recognizes that JDK11 is installed and then configures the Windows Services appropriately on creation

      • The installer may not recognize installed Java 11 instances and automatically configure the Windows Services to use those instead - see BSERV-11985

      Actual Results

      The service fails to start, and the following exception is thrown in the AtlassianBitbucketElasticsearch.<DATE>.log file:

      [2019-09-26 20:48:46] [info]  [  916] Commons Daemon procrun (1.0.15.0 64-bit) started
      [2019-09-26 20:48:46] [info]  [  916] Running 'AtlassianBitbucketElasticsearch' Service...
      [2019-09-26 20:48:46] [info]  [ 1460] Starting service...
      [2019-09-26 20:48:46] [error] [ 2568] CreateJavaVM Failed
      [2019-09-26 20:48:46] [error] [ 2568] The system cannot find the file specified.
      [2019-09-26 20:48:46] [error] [ 1460] Failed to start Java
      [2019-09-26 20:48:46] [error] [ 1460] ServiceStart returned 4
      [2019-09-26 20:48:46] [info]  [  916] Run service finished.
      [2019-09-26 20:48:46] [info]  [  916] Commons Daemon procrun finished
      
      • This exception is also thrown in the System section of the Windows Event Viewer

      Workaround

      Remove the following entries from the Java Options section of the Java tab in the Elasticsearch Windows Service configuration window:

      -XX:+PrintGCDetails
      -XX:+PrintGCDateStamps
      -XX:+PrintTenuringDistribution
      -XX:+PrintGCApplicationStoppedTime
      -Xloggc:<PATH_TO_GC_LOGS>
      -XX:+UseGCLogFileRotation
      -XX:NumberOfGCLogFiles=32
      -XX:GCLogFileSize=64m
      
      • Adding back the following options will retain the ability to log GC activity:
        • -Xlog:safepoint,gc*,gc+age*=trace:file=<PATH_TO_GC_LOGS>:time:filecount=32,filesize=64m

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              eslaughter@atlassian.com Evan Slaughter
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Backbone Issue Sync