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
    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(
        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(

  • 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.


@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.