Error when installing SonarQube 9.6 as a windows service

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    9.6.0.59041

  • what are you trying to achieve
    Upgrade to the latest version

  • what have you tried so far to achieve this
    I tried to use the old batch files but they expect wrapper.exe but that file no longer exists
    There is a SonarServiceWrapper.exe in the lib folder but no documentation on how to use it.

Hey there.

SonarQube v9.6 is not officially released yet. The documentation will be updated soon alongside the formal release.

Ok that wasn’t clear to me, I just saw the notification “There’s a new version of SonarQube available. Update to enjoy the latest updates and features” didn’t release that this was a pre-release.

That’s… interesting, and probably indicates something a little out of order in our release process. Sorry for being a bit direct before.

  1. I’ll raise a point about this. Ideally users wouldn’t be told to upgrade before the documentation is published.
  2. You can now find details in the Upgrade Notes

I followed the insructions to install the windows service, but it fails to start. The log file says

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" 

Failed to start service.
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified

SonarQube does start when, in a cmd-box, I cd to directory %NEW_SONAR_HOME%\bin\windows-x86-64\ and execute manually what is stated in the log file at %JAVA_EXE% etcetera

Hi Colin, setting ‘encrypt=false’ helped to fix connection problem. Now I can’t start SonarQube as a service. Starting from console with ‘StartSonar.bat’ works OK.
SonarServiceWrapper.wrapper.log (1.5 KB)

Hm. This is the second report of this error message.

2022-08-17 10:54:31,187 DEBUG - Starting WinSW in console mode
2022-08-17 10:54:31,202 INFO  - Starting service 'SonarQube (SonarQube)'...
2022-08-17 10:54:31,330 DEBUG - Starting WinSW in service mode
2022-08-17 10:54:31,344 INFO  - Service 'SonarQube (SonarQube)' started successfully.
2022-08-17 10:54:31,362 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-08-17 10:54:31,378 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)

I’ll get in touch with the right team on this and merge the threads.

Just ran into this with a freshly downloaded 9.6.0.59041

When running “SonarService.bat install”, the value of %JAVA_EXE% is being correctly determined by lib\find_java.bat, however it’s not then being written into SonarServiceWrapper.xml.

If you manually edit SonarServiceWrapper.xml and set the path to your java.exe in the element, the service starts up as expected.

Cheers, Stu

5 Likes

This worked for me

Is there a fix expected ?

The fix can be tracked in this ticket [SONAR-17224] - Jira .

1 Like

I am getting the same issue with JAVA_EXE
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
I have not tried manually editing SonarServiceWrapper.xml.
Is a fix expected soon?

SonarQube 9.6.1 will be released, at latest next week, with a fix for this issue.

3 posts were split to a new topic: Can’t start SonarQube 9.6

Hi,

SonarQube 9.6.1, with a fix for the issue, is now available.

Chris

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.