SonarCloud's client Scanner throws exceptions with 'java.lang.NumberFormatException: For input string: ""'

sonarcfamily
sonarqube

(Elliot Chen) #1

I have a project which is running at Linux with C++ compiler. And I can run compiling successfully, but always got error while running SonarQube Scanner. Can you shed some lights here? Below is the log. Thank you.

/home/PPP/workspace/toolchain-4.6.3/linux/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/include/c++/4.6.3/arm-none-linux-gnueabi
/home/PPP/workspace/toolchain-4.6.3/linux/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/include/c++/4.6.3/backward
/home/PPP/workspace/toolchain-4.6.3/linux/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/include
/home/PPP/workspace/toolchain-4.6.3/linux/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/include-fixed
/home/PPP/workspace/toolchain-4.6.3/linux/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/include
/home/PPP/workspace/toolchain-4.6.3/linux/arm-2012.03/bin/../arm-none-linux-gnueabi/libc/usr/include
End of search list.
COMPILER_PATH=/home/PPP/workspace/toolchain-4.6.3/linux/arm-2012.03/bin/../libexec/gcc/arm-none-linux-gnueabi/4.6.3/:/home/PPP/workspace/toolchain-4.6.3/linux/arm-2012.03/bin/../libexec/gcc/:/home/PPP/workspace/toolchain-4.6.3/linux/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/bin/
LIBRARY_PATH=/home/PPP/workspace/toolchain-4.6.3/linux/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/:/home/PPP/workspace/toolchain-4.6.3/linux/arm-2012.03/bin/../lib/gcc/:/home/PPP/workspace/toolchain-4.6.3/linux/arm-2012.03/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.3/../../../../arm-none-linux-gnueabi/lib/:/home/PPP/workspace/toolchain-4.6.3/linux/arm-2012.03/bin/../arm-none-linux-gnueabi/libc/lib/:/home/PPP/workspace/toolchain-4.6.3/linux/arm-2012.03/bin/../arm-none-linux-gnueabi/libc/usr/lib/
COLLECT_GCC_OPTIONS='-std=c++0x' '-v' '-dM' '-E' '-shared-libgcc' '-march=armv5te' '-mtls-dialect=gnu' '-funwind-tables' '-D' ' _ _CS_SOURCERYGXX_MAJ__=2012' '-D'  '_ _CS_SOURCERYGXX_MIN__=3' '-D' '_ _CS_SOURCERYGXX_REV__=57'
 
16:11:38.128 INFO: ------------------------------------------------------------------------
16:11:38.128 INFO: EXECUTION FAILURE
16:11:38.128 INFO: ------------------------------------------------------------------------
16:11:38.129 INFO: Total time: 31.013s
16:11:38.364 INFO: Final Memory: 28M/207M
16:11:38.365 INFO: ------------------------------------------------------------------------
16:11:38.365 ERROR: Error during SonarQube Scanner execution
**java.lang.NumberFormatException: For input string: ""**
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:592)
        at java.lang.Integer.parseInt(Integer.java:615)
        at com.sonar.cpp.N.A.A(na:400)
        at com.sonar.cpp.plugin.R.A(na:3517)
        at com.sonar.cpp.plugin.R.execute(na:1072)
        at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:45)
        at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:88)
        at org.sonar.scanner.phases.SensorsExecutor.lambda$execute$1(SensorsExecutor.java:65)
        at org.sonar.scanner.phases.SensorsExecutor.withGlobalStrategy(SensorsExecutor.java:80)
        at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:65)
        at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:74)
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:164)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:319)
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:314)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:288)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
        at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:82)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:131)
        at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        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.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)

(Loïc Joly) #2

Hello Elliot,

Could you please tell us which version of the SonarCFamily plugin you are using?

Thank you,


(Loïc Joly) #4

Hello again Elliot,

You tagged this post with SonarCloud, but your title is about SonarQube. So which one is it?

If this is about SonarCube, we have recently corrected an issue with the same behaviour as what you described. It is going to be deployed on SonarCloud soon. A temporary workaround would be to use a more recent version of gcc to build this code.

If it is for SonarQube, then we need the exact plugin version for further investigation…

Thank you,


(Elliot Chen) #5

Hi, Joly:
I’m using SonarCloud, and followed the instructions to download the scanner and build wrapper.
image

The scanner i believe is ‘SonarQube’.

For SonarCFamily plugin version, could you let me know how to check?

Thanks for your reply.


(Elliot Chen) #6

Hi, Joly, could you give me more info about this? When the new version of the SonarCloud’s client will be available to fix this problem? Thank you.


(Evgeny Mandrikov) #7

Don’t know what you mean by “client”, but this is not about “client” whatever it means - it is about version of SonarCFamily Plugin that is deployed by SonarSource company on SonarCloud.io server. And AFAIK version 6.0 with fix will be deployed tomorrow.


(Elliot Chen) #8

Hi, Evgeny, I ‘mean’ the client ‘build wrapper’ or ‘scanner’ which throws the exception at my last step. Also I assume the SonarCFamily Plugin shall be updated from server during the running of build wrapper.
It’s good to hear that tomorrow we can have a new version to try since we need finish evaluating the service before the trial is ending. Thank you for your reply.