Running Stash as a Service

Hello,

I'm quite new to stash so this may sound like a stupid question. :-)

I have recently installed Stash 2.12.3 and have run through the processs to install this as a Windows service. However, whenever i restart the server the service stops and Stash fails to start, so i have to go through the process of running the stop_stash then the start_stash batch files. Then stash opens fine and the windows service then stops (its set to automatic)

I am running the windows service as an admin with the relevanr rights. I have also instsalled the service without any issue and changed the relevant dll's to the 64 bit version. I don't belive its a Java issue as the applicatoon starts when the batch file is run and the env variable is set.

Any ideas/advice wouyld be appreciated

Many Thanks

Chris

4 answers

Hi there,

Do you have a dedicate user to start Stash service?

Does this user has rights to read/write Stash_Home folder?

You can check the permissions right clicking in the service name and them properties.

There you can set the user who runs the service.

Please give it a try and let me know how it goes.

Also, please check if all steps mentioned on this document were followed:

https://confluence.atlassian.com/display/STASH/Running+Stash+as+a+Windows+service

Regards,

Celso Yoshioka

Hi Chris,

I had to install the Java JDK (which installs the JRE), and I did so on the C:\Java folder level so there were no space in path issues.

I also set the Stash service to delay start (usually 2 minutes) to allow all services such as MySQL to complete startup.

I found that I had to have system level environment variables for both JAVA_HOME and JAVA_JRE set as listed below in my install notes below.

I also found that the MySQL connector needs to be in a different folder when Stash is started as a service:

https://answers.atlassian.com/questions/140373/stash-as-service-fails-to-find-mysql-driver

Install Java, 64 bit JDK (not JRE) (but with private JRE which comes with the JDK) at

C:\Java\jdk

and

C:\Java\jre

do NOT install with paths which have spaces!

Set up system level environment variables

JAVA_HOME = C:\Java\jdk

JAVA_JRE = C:\Java\jre

Perhaps this might help. I did follow all their recommended steps for creating the user, etc. as it shows in the documentation. Be particularly certain that the user has appropriate rights.

Hi John,

This has worked!! I am connecting to aa MYSQL DB and pretty sure the Atlassian documenetation states that the driver needs to be in the home directory and not the instaqll location.

Anyway thanks for the help and advice.

Kind Regards

Hi Celso,

Thanks for the feeback but i have now fixed this through the advice received from John.

Thanks

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

638 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot