SonarQube 7.9LTS Fails to Start When Built from Source

Hello,

I have followed the instructions to download the source for version 7.9, built using Gradle and started as per the readme.md, on Windows 10, 64 bit.

SonarQube however fails to start. The web.log shows:

2019.07.27 21:26:22 INFO web[o.s.p.ProcessEntryPoint] Starting web
2019.07.27 21:26:23 INFO web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2019.07.27 21:26:23 ERROR web[o.s.s.p.Platform] Web server startup failed
java.lang.NumberFormatException: For input string: “null”
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Long.parseLong(Long.java:692)
at java.base/java.lang.Long.parseLong(Long.java:817)
at org.sonar.api.utils.Version.parseFieldAsLong(Version.java:175)
at org.sonar.api.utils.Version.parse(Version.java:137)
at org.sonar.api.internal.MetadataLoader.loadVersion(MetadataLoader.java:50)
at org.sonar.server.platform.platformlevel.PlatformLevel1.configureLevel(PlatformLevel1.java:87)
at org.sonar.server.platform.platformlevel.PlatformLevel.configure(PlatformLevel.java:74)
at org.sonar.server.platform.Platform.start(Platform.java:208)
at org.sonar.server.platform.Platform.startLevel1Container(Platform.java:170)
at org.sonar.server.platform.Platform.init(Platform.java:86)
at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:43)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4817)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5283)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2019.07.27 21:26:24 WARN web[o.a.c.u.SessionIdGeneratorBase] Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [200] milliseconds.
2019.07.27 21:26:24 INFO web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2019.07.27 21:26:24 INFO web[o.s.p.ProcessEntryPoint] Hard stopping process

Please could you tell me what is missing? It appears to not to be populating it’s version. Is there another configuration not documented in the readme.md file that is needed?

With thanks,

Will

Hi Will,

I’m guessing you’re using a bleeding-edge (pre-release?) version of Java and SonarQube is failing to parse the version number. Fall back to a the latest Java 11, and you should be fine.

 
Ann

Hi Ann,

Thanks for your reply.

I did try multiple versions of java. Note this occurs both when:

  1. downloading and extracting the zip and setting the path explicitly in wrapper.conf and
  2. when running the installer (and adding to the System PATH the java\bin directory).

The version that produced the above output is:

C:\sonar\java\jdk-11.0.4\bin>java -version
java version “11.0.4” 2019-07-16 LTS
Java™ SE Runtime Environment 18.9 (build 11.0.4+10-LTS)
Java HotSpot™ 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)

using this setting in wrapper.conf

wrapper.java.command=…/…/…/java/jdk-11.0.4/bin/java.exe OR using
wrapper.java.command=java (when installing java with the installer and PATH update).

The same error occurs with 11.0.0 and 12.0.2 (as you thought it might).
It also fails with an incompatibility error when using the older 8.0 (aka 1.8 - but that behaviour is by design).

I also tried the OpenJDK version 11 and this also produces the same error.

This is on Windows 10 64bit with all the latest updates. There are no other java copies installed.

Does it require some other configuration?

Kind regards,

Will

Hi Will,

I’m a little behind you with:

$ java -version
openjdk version "11.0.3" 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu218.04.1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu218.04.1, mixed mode, sharing)

Admittedly, I’m building from a slightly different copy of the source than you are, but I built (skipping tests) and started up just fine.

Out of curiosity, your quoted path shows you executed -version from next to the executable. I wonder if you get the same value from another directory? I.e. I wonder if your default Java is the one you think it is. (Yes, I know you said you’ve only got one installed.)

Also, do you have any problems starting a downloaded instance?

 
Ann

Thanks Ann,

I have confirmed this and I am confident that the there is only one active java installation and that the code was built using the same one.

Can you please download and test the build on Windows 10 64bit rather than linux?

I ran: gradlew build -x test from the administrator command prompt

Without excluding the tests the build fails with 24 failed tests.

Kind regards,

Will

Hi,

Could you please tell us if you have a file called sonar-api-version.txt inside the folder ‘sonar-plugin-api\build\resources\main’.

Did you clone the repository ? If yes, have you modified this file ?

Thanks.

Mickaël

Hi Mickaël,

Thanks for your response.

The value within that file reads: 7.9.0.null

I simply took the tagged 7.9 release from the releases tab in github, downloaded and extracted and ran the gradlew build command as per the readme.

Thanks

Will

Hi,

Following investigation, i opened up an ticket on our side to fix this issue : https://jira.sonarsource.com/browse/SONAR-12369

We’ll let you know when it will be fixed.

Thanks.

1 Like

Hi Mickaël,

Thanks for raising a ticket. Is there a workaround in the meantime?

Will

Hi,

Yes, sorry, you can edit the file mentionned, and, instead of 7.9.0.null you can just replace the null by an extra 0. I didn’t test it but it should be working.

Hi Mickaël,

Thanks - that seems to have worked.

Will

Hello,

https://jira.sonarsource.com/browse/SONAR-12369 is being fixed in 8.0.
I’ve documented two workarounds in the ticket.

Cheers,

1 Like