SonerQube doesnt start

Hello!

I started to install sonarqube.
Installed nginx and mysql and sonar.

When i start script /opt/sonarqube/bin/linux/sonar.sh - it failed.

Sonarqube Startup script does not start ob ubuntu 16.04

Error log shows:

Encountered an error running main: java.lang.IllegalStateException: SonarQube requires Java 11+ to run
java.lang.IllegalStateException: SonarQube requires Java 11+ to run
    at org.sonar.application.App.checkJavaVersion(App.java:93)
    at org.sonar.application.App.start(App.java:56)
    at org.sonar.application.App.main(App.java:98)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
    at java.lang.Thread.run(Thread.java:748)
<-- Wrapper Stopped
--> Wrapper Started as Console
Launching a JVM...
Startup failed: Timed out waiting for a signal from the JVM.
JVM did not exit on request, terminated
JVM Restarts disabled.  Shutting down.
<-- Wrapper Stopped

If i run java -version:


    java version "11.0.3" 2019-04-16 LTS
    Java(TM) SE Runtime Environment 18.9 (build 11.0.3+12-LTS)
    Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.3+12-LTS, mixed mode)

Plz help ! :-(

Hello,

There’s actually a helpful message in the very log you posted!

SonarQube requires Java 11+ to run

Requirements are here if needed, also note that MySQL is not supported.

The second output:
java version “11.0.3”

Is it not 11+ ?

Doh, this is my bad for overlooking this.

From distant memory I think in such case you might want to make sure which Java SonarQube is picking up under the hood. Full startup logs might help (see troubleshooting doc), also maybe a quick look into the wrapper.java.command under conf/wrapper.conf (in install directory).

I solve it by edit wrapper.conf:

**wrapper.java.command=/usr/bin/java**  
2 Likes

Could you please explain little more? If I edit the wrapper.java.command then I am getting another error.
Error: Unable to execute Java command. The system cannot find the file specified. (0x2) “\prince\bin\java**”
Critical error: wait for JVM process failed
So what value I have to provide for wrapper.java.command.

Hi,

the path to java executable must be written without **. I believe @cryptoparty wanted to use the ‘*’ for formatting in his post. See comments in sonarqube-7.9.1\conf\wrapper.conf

> # Path to JVM executable. By default it must be available in PATH.
> # Can be an absolute path, for example:
> #wrapper.java.command=/path/to/my/jdk/bin/java
> wrapper.java.command=java

The easiest way is to set JAVA_HOME and add JAVA_HOME/bin to path, you will need that anyway for other java related tools.

Gilbert

1 Like

From where I can find the path to java executable. Could you please write one example also?

Hi,

JAVA_HOME has to be set to the root folder of your Java installation, i.e. a typical windows path
c:\Program Files\Java\jdk-11
The java executable java.exe lies in %JAVA_HOME%\bin folder which in this example means
c:\Program Files\Java\jdk-11\bin
Setting the environment variables with start windows settings via Win-Key + Pause, then

Gilbert

1 Like

Or you could simply use:

wrapper.java.command=C:\Program Files\Java\jdk-11.0.4\bin\java.exe

3 Likes

Gilbert,

Thanks, that worked. But now I am facing another issue. SonarQube doesn’t start and after few seconds the batch execution is stopped.

wrapper | Got ping response from JVM
jvm 1 | 2019.08.30 00:04:54 INFO app[o.s.a.SchedulerImpl] Process[web] is stopped
jvm 1 | 2019.08.30 00:04:55 INFO app[o.s.a.SchedulerImpl] Process[es] is stopped
jvm 1 | 2019.08.30 00:04:55 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped
jvm 1 | Wrapper Manager: ShutdownHook started

This is not the complete sonarqube-x.x.x\logs\sonar.log, can’t see an error message or stacktrace, please provide the whole logfile if possible (anonymize servernames and so on …)
Are there any error messages in sonarqube-x.x.x\logs\web.log or
sonarqube-x.x.x\logs\es.log ?

Gilbert,

Attached the log files. Let me know if you need anything else.
es.txt (4.4 KB) sonar.txt (2.9 KB) web.txt (17.8 KB)

Hi,

the es.log has

org.elasticsearch.cluster.block.clusterblockexception: blocked by: [FORBIDDEN…

That might fix the problem:
Stop Sonarqube and delete the ..\sonarqube-x.x.x\data\es6\ folder, then start Sonarqube again.
Gilbert

yes, if you don’t need the Java environment otherwise or if JAVA_HOME already exists but points to an older version this is the way to go.

I deleted the folder but getting the same error. Is there any other option to solve this issue.

Thanks,
Prince J Painadath

Hi Prince.

You’re running out of free space on your disk. You need to free some disk space and follow the instructions of section “Recovering from Elasticsearch read-only indices” in https://docs.sonarqube.org/latest/setup/troubleshooting/ (where it says “non-DCE”).

1 Like

Hi Felipe,

Thanks that issue was solved.
Now I am getting the below error when try to run the MsBuild.exe /t:Rebuild.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MsBuild.exe /t:Rebuild

‘C:\Program’ is not recognized as an internal or external command,
operable program or batch file.

Thanks,
Prince J Painadath

Hi,

one of the classic Windows gotchas, thanks Microsoft.
Because of the blanks in path you have to use surrounding " " , i.e.

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MsBuild.exe" /t:Rebuild

If using parameters with blanks you need to put it between " " too.

Gilbert

1 Like

Thanks Gilbert. It’s worked fine.

Thanks,
Prince J Painadath