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

<Bitbucket Server installation directory>\elasticsearch\bin\service.bat is pointing to the wrong location for Elasticsearch config folder.

    XMLWordPrintable

Details

    Description

      Summary

      When installing Bitbucket from the ZIP archive in Windows, the services won't be automatically created as expected. To create the services, one must go over the instructions of the article below, however it's not possible to create the Elasticsearch service in windows, since the batch file responsible for creating the service is checking the wrong location.

      https://confluence.atlassian.com/bitbucketserver/running-bitbucket-server-as-a-windows-service-776640048.html/

      How to Replicate

      1. Download the ZIP archive for Bibtucket 5.9.1
      2. Install it;
      3. Go over the Running Bitbucket Server as a Windows service to create the services;
      4. At step 9 change directory as instructed;
      5. At step 10 run the command below to create the Elasticsearch service
        service.bat install MyName
        
      6. This will result in the following message:

      Expected Results

      Elasticsearch service must be created

      Actual Results

      After running the

      service.bat install MyName

      the following message will be shown and the service won't be created

      FINDSTR: Cannot open <BBitbucket Server installation directory>\elasticsearch\config\jvm.options
      

      Notes

      What is causing the issue is that the <Bitbucket Server installation directory>\elasticsearch\bin\service.bat is pointing to the wrong location while trying to find the jvm-options file.

      In the batch file we can see the following

      :foundJVM
      if "%ES_JVM_OPTIONS%" == "" (
      set ES_JVM_OPTIONS=%ES_HOME%\config\jvm.options
      )
      

      In the code above we can see that it is trying to check for the file in %ES_HOME%\config however, there's no config folder but config-template.

      Workaround

      1. Edit the <Bitbucket Server installation directory>\elasticsearch\bin\service.bat
      2. replace
        :foundJVM
        if "%ES_JVM_OPTIONS%" == "" (
        set ES_JVM_OPTIONS=%ES_HOME%\config\jvm.options
        )
        
      3. For
        :foundJVM
        if "%ES_JVM_OPTIONS%" == "" (
        set ES_JVM_OPTIONS=%ES_HOME%\config-template\jvm.options
        )
        
      4. run the command in the step 10 of the article again;

      Attachments

        Issue Links

          Activity

            People

              fdoherty@atlassian.com Frank Doherty
              dgnoato@atlassian.com Douglas Gnoato
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: