SonarSource error 'IllegalStateException' thrown

Template for a good bug report, formatted with Markdown:

  • Versions used (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube 8.0
    build-wrapper, version 6.4 (linux-x86)
    SonarQube Scanner 4.2.0.1873
    Java 11.0.3 AdoptOpenJDK (64-bit)
    Linux 3.10.0-514.26.2.el7.x86_64 amd64

  • Error observed (wrap logs/code around triple quote ``` for proper formatting)
    Here is the exception that’s being thrown. I can provide full debug output in a PM. This is the first time running a scan on this code. I’ve been able to run with other projects with the same setup just fine.

14:51:29.381 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
  * you are using the latest version of the build-wrapper and the SonarCFamily analyzer
  * you are correctly invoking the scanner with correct configuration  * your compiler is supported
  * you are wrapping your build correctly
  * you are wrapping a full/clean build
  * you are providing the path to the correct build-wrapper output directory
        at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:255)
        at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:62)
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.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.scan.ProjectScanContainer.scan(ProjectScanContainer.java:387)
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:383)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:346)
        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.doAfterStart(GlobalContainer.java:141)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
        at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        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(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)

  • Steps to reproduce
  1. No successful scans (first time for the repo)
  2. Generate the build using cmake
  3. build-wrapper-linux-x86-64 --out-dir bw-outputs make -j4
  4. sonar-scanner
  • Potential workaround
    No workaround that I know of

Hello @leisinmr,
SonarCFamily 6.5 is released. It contains a lot of fixes and the reported exception might be one of them. Please update your plugin and let me know if you still face this exception.

Hi Abbas, thanks for your reply.

I updated my plugin and build-wrapper to 6.5. I still see the same error.

Please let me know if there’s any other information I can provide.

Matt

@leisinmr to debug the failure I will need to examine the files in the build-wrapper directory and the logs of the scanner when run in debug mode.
Please share these files privatetly if they contain sensitive information.

I would like to keep the details private. How exactly do I do that? I can’t seem to find the details on how to send a PM.

After reading through a few posts I see this one describing how to send a PM but I do not see a Message button after clicking on your Avatar.

1 Like

I sent you a PM

As discussed with @leisinmr, the analyzer was failing because there was only headers files in the directory. For the analyzer to succeed, it must analyze at least one source file.