Unable to start SonarQube Service on Windows machine

Must-share information (formatted with Markdown):

  • sonarqube-9.6.0.59041
  • using SonarQube service
  • I have made any modifications I could to the environment variables to ensure locations and folders can be found.

SonarServiceWrapper.wrapper.log

2022-09-22 09:32:10,765 DEBUG - Starting WinSW in service mode
2022-09-22 09:32:19,432 DEBUG - Starting WinSW in service mode
2022-09-22 09:32:19,462 INFO  - Starting %JAVA_EXE%  -Xms8m -Xmx32m -Djava.awt.headless=true --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -cp "..\..\..\lib\sonar-application-9.6.0.59041.jar" "org.sonar.application.App" 
2022-09-22 09:32:19,477 ERROR - Failed to start service.
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at WinSW.Util.ProcessHelper.StartProcessAndCallbackForExit(Process processToStart, String executable, String arguments, Dictionary`2 envVars, String workingDirectory, Nullable`1 priority, ProcessCompletionCallback callback, LogHandler logHandler, Boolean hideWindow)
   at WinSW.WrapperService.StartProcess(Process processToStart, String arguments, String executable, LogHandler logHandler)
   at WinSW.WrapperService.DoStart()
   at WinSW.WrapperService.OnStart(String[] args)
2022-09-22 09:37:19,337 DEBUG - Starting WinSW in service mode
2022-09-22 09:37:19,399 INFO  - Starting %JAVA_EXE%  -Xms8m -Xmx32m -Djava.awt.headless=true --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -cp "..\..\..\lib\sonar-application-9.6.0.59041.jar" "org.sonar.application.App" 
2022-09-22 09:37:19,434 ERROR - Failed to start service.
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at WinSW.Util.ProcessHelper.StartProcessAndCallbackForExit(Process processToStart, String executable, String arguments, Dictionary`2 envVars, String workingDirectory, Nullable`1 priority, ProcessCompletionCallback callback, LogHandler logHandler, Boolean hideWindow)
   at WinSW.WrapperService.StartProcess(Process processToStart, String arguments, String executable, LogHandler logHandler)
   at WinSW.WrapperService.DoStart()
   at WinSW.WrapperService.OnStart(String[] args)
2022-09-22 09:39:13,490 DEBUG - Starting WinSW in service mode
2022-09-22 09:43:11,918 DEBUG - Starting WinSW in console mode
2022-09-22 09:43:15,314 DEBUG - Starting WinSW in console mode
2022-09-22 09:43:15,333 INFO  - Starting service 'SonarQube (SonarQube)'...
2022-09-22 09:43:15,529 DEBUG - Starting WinSW in service mode
2022-09-22 09:43:15,544 INFO  - Service 'SonarQube (SonarQube)' started successfully.
2022-09-22 09:43:15,564 INFO  - Starting %JAVA_EXE%  -Xms8m -Xmx32m -Djava.awt.headless=true --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -cp "..\..\..\lib\sonar-application-9.6.0.59041.jar" "org.sonar.application.App" 
2022-09-22 09:43:15,579 ERROR - Failed to start service.
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at WinSW.Util.ProcessHelper.StartProcessAndCallbackForExit(Process processToStart, String executable, String arguments, Dictionary`2 envVars, String workingDirectory, Nullable`1 priority, ProcessCompletionCallback callback, LogHandler logHandler, Boolean hideWindow)
   at WinSW.WrapperService.StartProcess(Process processToStart, String arguments, String executable, LogHandler logHandler)
   at WinSW.WrapperService.DoStart()
   at WinSW.WrapperService.OnStart(String[] args)
2022-09-22 09:43:48,178 DEBUG - Starting WinSW in service mode
2022-09-22 09:43:48,206 INFO  - Starting %JAVA_EXE%  -Xms8m -Xmx32m -Djava.awt.headless=true --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -cp "..\..\..\lib\sonar-application-9.6.0.59041.jar" "org.sonar.application.App" 
2022-09-22 09:43:48,222 ERROR - Failed to start service.
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at WinSW.Util.ProcessHelper.StartProcessAndCallbackForExit(Process processToStart, String executable, String arguments, Dictionary`2 envVars, String workingDirectory, Nullable`1 priority, ProcessCompletionCallback callback, LogHandler logHandler, Boolean hideWindow)
   at WinSW.WrapperService.StartProcess(Process processToStart, String arguments, String executable, LogHandler logHandler)
   at WinSW.WrapperService.DoStart()
   at WinSW.WrapperService.OnStart(String[] args)

Hi,

Welcome to the community!

What’s the path to the java.exe? And how does it show up in your %PATH%?

 
Ann

java.exe = C:\Program Files\Java\jre1.8.0_341\bin

and it shows up in %path% for both user and system environment variables as
C:\Program Files\Java\jre1.8.0_341

Hi,

Java 8 isn’t supported for SonarQube 9.6. You’re not getting the behavior / error I would expect for this mismatch, but the first step is to upgrade to Java 11. Hopefully that does it, but if not, we can go from there.

 
HTH,
Ann

Alright, so I upgraded to jdk-11.0.16. New %PATH% set as C:\Program Files\Java\jdk-11.0.16. I am still not able to start the service. It appears as though I am getting the same error as before. However, I am still able to start SonarQube from the startSonar.bat, a point I did not think to mention previously. Not sure if that makes a difference.

Hi,

I just realized you’re on 9.6.0. There’s a fix for this in 9.6.1.

 
HTH,
Ann

And that fixed it!! Thank you for taking the time to work over this issue.

1 Like