Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to run bitbucket as service with home directory on a network drive

Dalmposter September 3, 2018

When trying to run a bitbucket server as a service with the home directory on a network drive and the install directory on a local drive the service starts then immediately stops. If however I run start-bitbucket.bat in the bin folder via cmd it runs perfectly fine. I have tried installing bitbucket with the home directory on a local drive (which works out of the box) then moving the home directory to the intended network drive but with no success. I have made sure my account and the atlbitbucket account have full permissions on the home and install directory.

In the case where I run the installer and tell it to put the home directory on the network drive it creates the shared and logs folder but doesn't write to any of the logs except commons-daemon and doesn't create any more of the home directory and won't run as a service occasionally saying "System cannot find the specified file". The elasticsearch service sometimes returns "Incorrect function" as an error message in windows event logs but the bitbucket service event logs just say it stopped unexpectedly.

In the case where I install it all on a local drive then try to move the home directory, the service just immediately stops upon telling it to start and produces no messages that I've found.

Things I've tried:
Repeatedly reinstalling
Changing the service to use my (administrator) account, the local system or the atlbitbucket account
Checked permissions to both directories for my account, atlbitbucket and the system
Set the owner of these directories to atlbitbucket

1 answer

1 accepted

0 votes
Answer accepted
Felipe Kraemer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 4, 2018

Hi @Dalmposter,

What seems to be happening here is a problem detecting the BITBUCKET_HOME environment variable.

When you start Bitbucket Server manually, by running <Bitbucket Install Dir>\bin\start-bitbucket.bat, the instance will use the BITBUCKET_HOME configured at <Bitbucket Install Dir>\bin\set-bitbucket-home.bat, usually configured in line #6.

When you try to start Bitbucket as Windows service though, the instance will not read <Bitbucket Install Dir>\bin\set-bitbucket-home.bat, but will use the path configured in the service.

Please follow the steps from the document How to update the JVM configuration for a Windows service until you reach the 'Java' tab. In this tab, you will find -Dbitbucket.home in the Java Options list:

Home.png

 

Edit the property value as needed, click "Apply", and try starting Bitbucket Server as Windows Service once more.

I hope this helps!

Regards,

Felipe  

Dalmposter September 6, 2018

I switched over to using a local drive but this did fix a similar issue I was having on another Bitbucket install as when I looked, the home variable was empty when I went to configure the service. I believe it would likely have fixed my original issue.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events