Error during SonarScanner execution java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found empty. Pl

Hi Team,

I’m using sonarScanner , try to scanner getting this issue., try to help on this

“build-wrapper-macosx-x86 --out-dir test1 xcodebuild clean build” this command Excuted and try to scanner the code via this command “sonar-scanner -X -Dsonar.login=16020f947f5197a4b5313be2e707f870103a1742” getting this error

10:58:01.035 INFO: EXECUTION FAILURE
10:58:01.035 INFO: ------------------------------------------------------------------------
10:58:01.036 INFO: Total time: 9.818s
10:58:01.094 INFO: Final Memory: 25M/94M
10:58:01.097 INFO: ------------------------------------------------------------------------
10:58:01.097 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The “build-wrapper-dump.json” file was found empty. Please make sure that:

  • you are using the latest version of the build-wrapper and the CFamily analyzer
  • your compiler is supported
  • you are wrapping your build correctly
  • you are wrapping a full/clean build
  • if you are building your project inside a Docker container, build-wrapper is wrapping the build process inside the container and not wrapping the external Docker process
    at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:478)
    at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:178)
    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:79)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
    at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:382)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:378)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:347)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
    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)

Hello @rameshmca68,

is this command building your project successfully?

What compiler are you using? is it in the supported compilers list?

Can you share the generated build-wrapper .json and .log files?

Thanks,

Hi @Abbas_Sabra, I am having this same problem
build-wrapper-dump.json

# (C) SonarSource SA, 2014-2016, contact@sonarsource.com
# All SONARSOURCE programs and content are copyright protected.
# SONARSOURCE and SONARQUBE are trademarks of SonarSource SA. All rights are expressly reserved.
#
# This file is designed exclusively for use with the SONARSOURCE C / C++ / Objective-C Plugin.
# It may not be used in connection with any other software.
# Any other use is prohibited by law and may be grounds for immediate termination of your License.
{
"version":0,
"captures":[
]}

build-wrapper.log

Fri Dec 17 15:47:07 2021: build-wrapper, version 3.10 (linux-x86)
Fri Dec 17 15:47:07 2021: System name: Linux Nodename: xxxxxxx Release: 5.4.0-90-generic Version: #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 Machine: x86_64
Fri Dec 17 15:47:07 2021: socket path: /tmp/build-wrapper-socket.DROuj3
Fri Dec 17 15:47:07 2021: dynamic library found: /home/.sonar/build-wrapper-3.10/linux-x86-64/libinterceptor-i686.so
Fri Dec 17 15:47:07 2021: dynamic library found: /home////jenkins/workspace////.sonar/build-wrapper-3.10/linux-x86-64/libinterceptor-x86_64.so
Fri Dec 17 15:47:07 2021: command executed as: <.sonar/build-wrapper-3.10/linux-x86-64/build-wrapper-linux-x86-64>
Fri Dec 17 15:47:07 2021: command line received: <cmake --build build/ --clean-first -v>
Fri Dec 17 15:47:07 2021: env 0: <JENKINS_HOME=/var/jenkins_home>
Fri Dec 17 15:47:07 2021: env 1: <BRANCH_IS_PRIMARY=true>
Fri Dec 17 15:47:07 2021: env 2: <SSH_CLIENT=xx.x.x.xx 53524 22>
Fri Dec 17 15:47:07 2021: env 21: <_=/usr/bin/java>
Fri Dec 17 15:47:07 2021: env 23: <STAGE_NAME=Build Wrapper>
Fri Dec 17 15:47:07 2021: env 24: <GIT_BRANCH=main>
Fri Dec 17 15:47:07 2021: env 25: <XDG_SESSION_CLASS=user>
Fri Dec 17 15:47:07 2021: env 26: <EXECUTOR_NUMBER=0>
Fri Dec 17 15:47:07 2021: env 27: <XDG_SESSION_ID=880>
Fri Dec 17 15:47:07 2021: env 28: <RUN_TESTS_DISPLAY_URL=http://xx.x.x.xx/job/main/16/display/redirect?page=tests>
Fri Dec 17 15:47:07 2021: env 29: <BUILD_DISPLAY_NAME=#16>
Fri Dec 17 15:47:07 2021: env 30: <HUDSON_HOME=/var/jenkins_home>
Fri Dec 17 15:47:07 2021: env 31: <JOB_BASE_NAME=main>
Fri Dec 17 15:47:07 2021: env 32: <PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin>
Fri Dec 17 15:47:07 2021: env 33: <BUILD_ID=16>
Fri Dec 17 15:47:07 2021: env 34: <XDG_RUNTIME_DIR=/run/user/1000>
Fri Dec 17 15:47:07 2021: env 37: <LANG=en_US.UTF-8>
Fri Dec 17 15:47:07 2021: env 40: <BUILD_NUMBER=16>
Fri Dec 17 15:47:07 2021: env 42: <SHELL=/bin/bash>
Fri Dec 17 15:47:07 2021: env 51: <BRANCH_NAME=main>
Fri Dec 17 15:47:07 2021: executing: <cmake --build build/ --clean-first -v>
Fri Dec 17 15:47:07 2021: initializing json file
Fri Dec 17 15:47:07 2021: process created with pid: 33035
Fri Dec 17 15:47:07 2021: parent pid: 33034
Fri Dec 17 15:47:07 2021: working directory: </home/xxxxx/jenkins/workspace/xxxxxxxx>
Fri Dec 17 15:47:07 2021: executable: </usr/bin/cmake>
Fri Dec 17 15:47:07 2021: argv[0]: <cmake>
Fri Dec 17 15:47:07 2021: argv[1]: <--build>
Fri Dec 17 15:47:07 2021: argv[2]: <build/>
Fri Dec 17 15:47:07 2021: argv[3]: <--clean-first>
Fri Dec 17 15:47:07 2021: argv[4]: <-v>
Fri Dec 17 15:47:07 2021: skipping process with pid: 33035
Fri Dec 17 15:47:07 2021: process created with pid: 33036
Fri Dec 17 15:47:07 2021: parent pid: 33035
Fri Dec 17 15:47:07 2021: working directory: </home/xxxxxxxxx/jenkins/workspace/xxxxxxxx/build>
Fri Dec 17 15:47:07 2021: executable: </usr/bin/cmake>
Fri Dec 17 15:47:07 2021: argv[0]: </usr/bin/cmake>
Fri Dec 17 15:47:07 2021: argv[1]: <-E>
Fri Dec 17 15:47:07 2021: argv[2]: <env>
Fri Dec 17 15:47:07 2021: argv[3]: <VERBOSE=1>
Fri Dec 17 15:47:07 2021: argv[4]: </usr/bin/make>
Fri Dec 17 15:47:07 2021: argv[5]: <clean>
Fri Dec 17 15:47:07 2021: skipping process with pid: 33036
Fri Dec 17 15:47:07 2021: process created with pid: 33037
Fri Dec 17 15:47:07 2021: parent pid: 33036
Fri Dec 17 15:47:07 2021: working directory: </home/xxxxxxxxx/jenkins/workspace/xxxxxxxx/build>
Fri Dec 17 15:47:07 2021: executable: </usr/bin/make>
Fri Dec 17 15:47:07 2021: argv[0]: </usr/bin/make>
Fri Dec 17 15:47:07 2021: argv[1]: <clean>
Fri Dec 17 15:47:07 2021: skipping process with pid: 33037
Fri Dec 17 15:47:07 2021: process created with pid: 33038
Fri Dec 17 15:47:07 2021: parent pid: 33037
Fri Dec 17 15:47:07 2021: working directory: </home/xxxxxxxxx/jenkins/workspace/xxxxxxxx/build>
Fri Dec 17 15:47:07 2021: executable: </usr/bin/make>
Fri Dec 17 15:47:07 2021: argv[0]: </usr/bin/make>
Fri Dec 17 15:47:07 2021: argv[1]: <-f>
Fri Dec 17 15:47:07 2021: argv[2]: <CMakeFiles/Makefile2>
Fri Dec 17 15:47:07 2021: argv[3]: <clean>
Fri Dec 17 15:47:07 2021: skipping process with pid: 33038
Fri Dec 17 15:47:07 2021: process created with pid: 33039
Fri Dec 17 15:47:07 2021: parent pid: 33035
Fri Dec 17 15:47:07 2021: working directory: </home/xxxxxxxxx/jenkins/workspace/xxxxxxxx/build>
Fri Dec 17 15:47:07 2021: executable: </usr/bin/cmake>
Fri Dec 17 15:47:07 2021: argv[0]: </usr/bin/cmake>
Fri Dec 17 15:47:07 2021: argv[1]: <-E>
Fri Dec 17 15:47:07 2021: argv[2]: <env>
Fri Dec 17 15:47:07 2021: argv[3]: <VERBOSE=1>
Fri Dec 17 15:47:07 2021: argv[4]: </usr/bin/make>
Fri Dec 17 15:47:07 2021: skipping process with pid: 33039
Fri Dec 17 15:47:07 2021: process created with pid: 33040
Fri Dec 17 15:47:07 2021: parent pid: 33039
Fri Dec 17 15:47:07 2021: working directory: </home/xxxxxxxxx/jenkins/workspace/xxxxxxxx/build>
Fri Dec 17 15:47:07 2021: executable: </usr/bin/make>
Fri Dec 17 15:47:07 2021: argv[0]: </usr/bin/make>
Fri Dec 17 15:47:07 2021: skipping process with pid: 33040
Fri Dec 17 15:47:07 2021: process created with pid: 33041
Fri Dec 17 15:47:07 2021: parent pid: 33040
Fri Dec 17 15:47:07 2021: working directory: </home/xxxxxxxxx/jenkins/workspace/xxxxxxxx/build>
Fri Dec 17 15:47:07 2021: executable: </usr/bin/cmake>
Fri Dec 17 15:47:07 2021: argv[0]: </usr/bin/cmake>
Fri Dec 17 15:47:07 2021: argv[1]: <-S/home/xxxxxxxxx/jenkins/workspace/xxxxxxxx>
Fri Dec 17 15:47:07 2021: argv[2]: <-B/home/xxxxxxxxx/jenkins/workspace/xxxxxxxx/build>
Fri Dec 17 15:47:07 2021: argv[3]: <--check-build-system>
Fri Dec 17 15:47:07 2021: argv[4]: <CMakeFiles/Makefile.cmake>
Fri Dec 17 15:47:07 2021: argv[5]: <0>
Fri Dec 17 15:47:07 2021: skipping process with pid: 33041
Fri Dec 17 15:47:07 2021: process created with pid: 33042
Fri Dec 17 15:47:07 2021: parent pid: 33040
Fri Dec 17 15:47:07 2021: working directory: </home/xxxxxxxxx/jenkins/workspace/xxxxxxxx/build>
Fri Dec 17 15:47:07 2021: executable: </usr/bin/cmake>
Fri Dec 17 15:47:07 2021: argv[0]: </usr/bin/cmake>
Fri Dec 17 15:47:07 2021: argv[1]: <-E>
Fri Dec 17 15:47:07 2021: argv[2]: <cmake_progress_start>
Fri Dec 17 15:47:07 2021: argv[3]: </home/xxxxxxxxx/jenkins/workspace/xxxxxxxx/build/CMakeFiles>
Fri Dec 17 15:47:07 2021: argv[4]: </home/xxxxxxxxx/jenkins/workspace/xxxxxxxx/build/CMakeFiles/progress.marks>
Fri Dec 17 15:47:07 2021: skipping process with pid: 33042
Fri Dec 17 15:47:07 2021: process created with pid: 33043
Fri Dec 17 15:47:07 2021: parent pid: 33040
Fri Dec 17 15:47:07 2021: working directory: </home/xxxxxxxxx/jenkins/workspace/xxxxxxxx/build>
Fri Dec 17 15:47:07 2021: executable: </usr/bin/make>
Fri Dec 17 15:47:07 2021: argv[0]: </usr/bin/make>
Fri Dec 17 15:47:07 2021: argv[1]: <-f>
Fri Dec 17 15:47:07 2021: argv[2]: <CMakeFiles/Makefile2>
Fri Dec 17 15:47:07 2021: argv[3]: <all>
Fri Dec 17 15:47:07 2021: skipping process with pid: 33043
Fri Dec 17 15:47:07 2021: process created with pid: 33044
Fri Dec 17 15:47:07 2021: parent pid: 33040
Fri Dec 17 15:47:07 2021: working directory: </home/xxxxxxxxx/jenkins/workspace/xxxxxxxx/build>
Fri Dec 17 15:47:07 2021: executable: </usr/bin/cmake>
Fri Dec 17 15:47:07 2021: argv[0]: </usr/bin/cmake>
Fri Dec 17 15:47:07 2021: argv[1]: <-E>
Fri Dec 17 15:47:07 2021: argv[2]: <cmake_progress_start>
Fri Dec 17 15:47:07 2021: argv[3]: </home/xxxxxxxxx/jenkins/workspace/xxxxxxxx/build/CMakeFiles>
Fri Dec 17 15:47:07 2021: argv[4]: <0>
Fri Dec 17 15:47:07 2021: skipping process with pid: 33044
Fri Dec 17 15:47:07 2021: finalizing json file
Fri Dec 17 15:47:07 2021: returned with code: 0

Let me know if you need any other information on my part.
Thanks

Vinnie