New install - service terminated / incorrect function
Asked by David Crowder:

We're trialing Confluence on Win2012R2. It's a fresh, vanilla install. The installer runs successfully, though it leaves a console window with Tomcat open.

After playing in Confluence for a few minutes, I exit the Tomcat window. That appears to kill Confluence. I search for a Windows service... but there isn't one.

I go searching for a batch file that might create the service, and find "C:\\Program Files\\Atlassian\\Confluence\\bin\\service.bat" that appears to do the job. I run it as administrator, with the "install" option. It installs a brand new Windows service. Terrific.

Only when I attempt to start the service, it errors out. The Windows application log shows this:

"The Atlassian Confluence Confluence240919080600 service terminated with the following service-specific error:  
Incorrect function."

The "commons-daemon" log shows this:

\[2019-09-24 09:06:55\] \[info\] \[ 3212\] Commons Daemon procrun (1.1.0.0 64-bit) started  
\[2019-09-24 09:06:55\] \[info\] \[ 3212\] Running 'Confluence240919080600' Service...  
\[2019-09-24 09:06:55\] \[info\] \[ 3692\] Starting service...  
\[2019-09-24 09:06:55\] \[error\] \[ 3692\] Failed creating Java  
\[2019-09-24 09:06:55\] \[error\] \[ 3692\] ServiceStart returned 1  
\[2019-09-24 09:06:55\] \[info\] \[ 3212\] Run service finished.  
\[2019-09-24 09:06:55\] \[info\] \[ 3212\] Commons Daemon procrun finished

So, at this point I'm a little lost on how to fix it. If it is broken with a stock install, I doubt uninstall / reinstall will gain me much. Advice?


Answers:
author: David Crowder
body: Checked the website to see if there was a newer version available. The version I downloaded last week was 7.0.1, while 7.0.2 is now available. Downloaded 7.0.2, unistalled 7.0.1 and installed 7.0.2. It installed the service correctly and we're off and running. Looks like it must have been a bug in 7.0.1.

comments: author: Diego
body: Thanks for sharing this result with us, [@David Crowder](/t5/user/viewprofilepage/user-id/3570163)!

Come share with the Community if you ever need.


author: Diego
body: Thanks for reaching out, [@David Crowder](/t5/user/viewprofilepage/user-id/3570163)!

As I understand, the system is facing some *++issues while trying to start the service++* as intended. This is most likely happening because we *++did not set the JAVA_HOME++* for the service. We can see this specific line:
> ++***\[2019-09-24 09:06:55\] \[error\] \[ 3692\] Failed creating Java***++

It seems that Windows is not even able to reach the Confluence execution step. Since this is a vital feature for servers, we have documentation on how to setup Confluence as a service in Windows.

Here, take a look:
> * ++***[\[Confluence Server\] Start Confluence Automatically on Windows as a Service](https://confluence.atlassian.com/doc/start-confluence-automatically-on-windows-as-a-service-172071.html)***++

The part that is really relevant for us is "*Manually Installing the Confluence Distribution as a Service*".

Let us know if the docs help you, David! Looking forward to your reply.

comments: author: David Crowder
body: This document basically has me doing the same steps that I figured out how to do on my own, and described above. It does not aid me in fixing the error. %JRE_HOME% is set, and pointing to: C:\\PROGRA\~1\\ATLASS\~1\\CONFLU\~1\\jre

(I have also tried it with long file names, spaces and no spaces, encased in quotes and without.)

Worth noting is that this is a fresh, vanilla install. So, I have not gone through the effort of uninstall / reinstall, as that seemed unlikely to fix the problem, and more likely to just repeat the same problem.

The service command is:

"C:\\Program Files\\Atlassian\\Confluence\\bin\\tomcat9.exe" //RS//Confluence


author: serge calderara
body: [@David Crowder](/t5/user/viewprofilepage/user-id/3570163) did you manage to sart the service, I am in teh same situation

Thnaks for sharing your solution


Tags: confluence-server

server