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

Java update on Windows get Bitbucket Server or Stash services to fail

    XMLWordPrintable

Details

    Description

      Summary

      When Java is updated on Windows and the installation of the previous Java version is removed, the service won't start up again without manual intervention to fix it.

      Environment

      • Bitbucket Server and Stash running as a Windows service

      Steps to Reproduce

      1. Install a Bitbucket instance
      2. Update to a newer Java version

      Expected Results

      • Service should be able to point to a newer version automatically.

      Actual Results

      The below exception is thrown in the commons-daemon log file and the service fails to start:

      [2016-02-13 23:18:05] [info]  [ 5920] Commons Daemon procrun (1.0.15.0 64-bit) started
      [2016-02-13 23:18:05] [info]  [ 5920] Running 'AtlassianBitbucket' Service...
      [2016-02-13 23:18:05] [info]  [ 5844] Starting service...
      [2016-02-13 23:18:05] [error] [ 5844] Failed creating java c:\program files\java\jre1.8.0_65\bin\server\jvm.dll
      [2016-02-13 23:18:05] [error] [ 5844] The system cannot find the path specified.
      [2016-02-13 23:18:05] [error] [ 5844] ServiceStart returned 1
      [2016-02-13 23:18:05] [error] [ 5844] The system cannot find the path specified.
      [2016-02-13 23:18:05] [info]  [ 5920] Run service finished.
      

      Notes

      It would be great if there was a solution that allowed the service to resolve which Java dll to use based on the environment JAVA_HOME beforehand.

      Workaround

      Service Name

      If you don't know the exact name of your old Bitbucket Server service, you can find out what they are by following the steps below:

      1. Navigate to 'Control Panel' > 'Administrative Tools' > 'Services'.
      2. The 'Services' window should appear.
      3. Right-click on the service you wish to find out the name of, and select 'Properties' from the popup menu.
      4. The 'Service name' should appear in the 'General' tab.
      • Use this parameter as a substitute for <ServiceName here> on the command below.

      After you checked the service name:

      • cd to the bin directory the Bitbucket Server Installation (<Bitbucket Server Installation dir>/bin).
      • Run from there:
        • For versions of Bitbucket Server 5.0+:
          • bservmgr.exe //ES//<ServiceName goes here>
        • For versions prior to Bitbucket Server 5.0+:
          • tomcat8w //ES//<ServiceName here>
      • Change the service
        • After inspecting the service window that was opened by the last command, you'll be able to identify that the JVM configured in it is pointing to the "old Java" dll (i.e c:\<old_java_path>\bin\server\jvm.dll whereas it should be pointing to new one c:\<new_java_path>\bin\server\jvm.dll.
        • If you change the dll accordingly, this issue will be fixed.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tbomfim ThiagoBomfim (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: