java.lang.NumberFormatException while running sonar-scanner

Almost identical to topic #39181, but with different versions.

  • Environment:
INFO: SonarQube Scanner
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Linux 4.15.0-129-generic amd64
  • Versions used:
SonarQube Enterprise server
build-wrapper 6.20
  • Error message:
java.lang.NumberFormatException: Expected an int but was 6.20 at line 9 column 17
	at com.sonar.cpp.plugin.CFamilySensor.process(
	at com.sonar.cpp.plugin.CFamilySensor.execute(
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(
	at org.sonar.core.platform.ComponentContainer.startComponents(
	at org.sonar.core.platform.ComponentContainer.execute(
	at org.sonar.scanner.scan.ProjectScanContainer.scan(
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(
	at org.sonar.core.platform.ComponentContainer.startComponents(
	at org.sonar.core.platform.ComponentContainer.execute(
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(
	at org.sonar.core.platform.ComponentContainer.startComponents(
	at org.sonar.core.platform.ComponentContainer.execute(
	at org.sonar.batch.bootstrapper.Batch.doExecute(
	at org.sonar.batch.bootstrapper.Batch.execute(
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(
	at org.sonarsource.scanner.cli.Main.execute(
	at org.sonarsource.scanner.cli.Main.execute(
	at org.sonarsource.scanner.cli.Main.main(

I have checked sonar-scanner version for 8.0:

Build wrapper, we grab from the server as documented:

Download Build Wrapper for Linux from {SonarQube URL}/static/cpp/

I have checked the plugin version matrix and it seems the c-family plugin is okay:

Anything else I should check for?

Hi @Won-Mean_Lee ,

you are using a new build-wrapper with an old version of the plugin, they should have the same version 6.8.

I am not sure you are downloading the build-wrapper from the same server you are running the analysis, you are either downloading it from a SonarQube 8.9 server or from SonarCloud.

You should eventually consider upgrading to a newer version.

Thank you, I will pass this along to the devops team!

Aha, we have at least two separate servers… one is on 8.0 and another on 8.9.

Hi @Won-Mean_Lee ,

that is why it is good to always download the build-wrapper at run time from the analysis server. Did you manage to fix your issue? Shall I consider this topic as closed?

Yep, we had a server url mismatch between the docker and jenkins script.
Yes, fixed. Please close. Thank you!

1 Like

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