The build-wrapper.json file exists but fails to analyze Sonacube C++

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube: SonarQube server 9.8.0.63668 Developer
    Scanner: SonarScanner 4.8.0.2856
  • how is SonarQube deployed: zip, Docker, Helm
    zip
    I’m working on sonarscanner with bamboo and the operation fails even if I have the build-wrapper.json file.
    The build-wrapper.json file and the build-wrapper.log file are too large to upload.
    bamboo task log
19-Jun-2023 15:54:14	total 0
19-Jun-2023 15:54:14	drwxr-xr-x 4 buildagent buildagent  57 Jun 19 15:48 .
19-Jun-2023 15:54:14	drwxr-xr-x 3 root       root        39 Jun 19 15:47 ..
19-Jun-2023 15:54:14	drwxrwxrwx 6 buildagent buildagent 192 Jun 19 15:48 CoNA
19-Jun-2023 15:54:14	drwxrwxr-x 2 buildagent buildagent  74 Jun 19 15:48 sonar_build_wrapper
19-Jun-2023 15:54:14	total 288956
19-Jun-2023 15:54:14	drwxrwxr-x 2 buildagent buildagent        74 Jun 19 15:48 .
19-Jun-2023 15:54:14	drwxr-xr-x 4 buildagent buildagent        57 Jun 19 15:48 ..
19-Jun-2023 15:54:14	-rw-rw-rw- 1 buildagent buildagent  95728028 Jun 19 15:54 build-wrapper-dump.json
19-Jun-2023 15:54:14	-rw-rw-rw- 1 buildagent buildagent 200158938 Jun 19 15:54 build-wrapper.log
19-Jun-2023 15:54:14	################################# Total Build Time : 6 minutes and 2 seconds elapsed.
19-Jun-2023 15:54:14	Finished task 'Build linux and Create Release Archive' with result: Success
19-Jun-2023 15:54:14	Skipping execution of task 'Copy Wrapper' as it is disabled
19-Jun-2023 15:54:14	All conditions for task 'Run SonarQube' were met. Conditions: Variable sonarbuildKey equals ccIC
19-Jun-2023 15:54:14	
Substituting variable: ${bamboo.SONAR_BUILD_WRAPPER_OUTDIR} with /data/bamboo-agent-home/xml-data/build-dir/PRBUILD-PRCOMTEST955-CCIC/sonar_build_wrapper
19-Jun-2023 15:54:14	Starting task 'Run SonarQube' of type 'ch.mibex.bamboo.sonar4bamboo:sonar4bamboo.sonarscannertask'
19-Jun-2023 15:54:14	
Substituting password variable: ${bamboo.sonarUserTokenPassword}
19-Jun-2023 15:54:14	
19-Jun-2023 15:54:14	SONAR4BAMBOO: Going to use executable home /data/build-tools/SonarQube/sonar-scanner
19-Jun-2023 15:54:14	SONAR4BAMBOO: Going to apply incremental mode...
19-Jun-2023 15:54:14	
Beginning to execute external process for build '01_PR_BUILD - 999_01. PR_COM.COM3.CONA(Master)_TEST - bugfix-CODEC-229309-sonarqube-test_CoNA-34493 - ccIC #1 (PRBUILD-PRCOMTEST955-CCIC-1)'
 ... running command line: 
/tmp/runInDocker3288033850512844903.sh /data/build-tools/SonarQube/sonar-scanner/bin/sonar-scanner -Dsonar.cfamily.threads=4 -Dsonar.projectBaseDir=./CoNA -Dsonar.cfamily.build-wrapper-output=/data/bamboo-agent-home/xml-data/build-dir/PRBUILD-PRCOMTEST955-CCIC/sonar_build_wrapper -Dsonar.exclusions=**/*.java,**/*.ts,**/*.js,**/*.d.ts,**/ExternalLibrary/**/*,platform/Common/cots/**/*,platform/Technical/Renderer/GraphicRenderer/FontRenderer/harfbuzz/**/*,platform/Technical/cots/**/*,platform/Dal/DaSearch/internal/Source/Hafao/**/*,**/platform/Dal/DaSearch/internal/Source/IROversea/**/*,**/*.html,**/*.c,**/*.xml,**/*.py,hmi/**/*,product/**/*,platform/BaseComponent/TrafficInfo/TpegSource/TPEG2Source/Module/Decoder/Component/MMC/**/* -Dsonar.projectKey=CoNA -Dsonar.projectName=CoNA -Dsonar.pullrequest.branch=bugfix/CODEC-229309-sonarqube-test_CoNA -Dsonar.pullrequest.base=master -Dsonar.pullrequest.key=34493 -Dsonar.host.url=https://${sonarUrl} -Dsonar.login=****** -Dsonar.language=CPP -Dsonar.inclusions=platform/Service/Guidance/internal/StringTable/Japan.h
ild	15-Jun-2023 18:51:17	INFO: 1 file indexed
build	15-Jun-2023 18:51:17	INFO: 33037 files ignored because of inclusion/exclusion patterns
build	15-Jun-2023 18:51:17	INFO: Quality profile for c: Misra C
build	15-Jun-2023 18:51:17	INFO: ------------- Run sensors on module CoNA
build	15-Jun-2023 18:51:17	INFO: Load metrics repository
build	15-Jun-2023 18:51:17	INFO: Load metrics repository (done) | time=23ms
build	15-Jun-2023 18:51:18	INFO: Sensor C# Project Type Information [csharp]
build	15-Jun-2023 18:51:18	INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
build	15-Jun-2023 18:51:18	INFO: Sensor C# Analysis Log [csharp]
build	15-Jun-2023 18:51:18	INFO: Sensor C# Analysis Log [csharp] (done) | time=10ms
build	15-Jun-2023 18:51:18	INFO: Sensor C# Properties [csharp]
build	15-Jun-2023 18:51:18	INFO: Sensor C# Properties [csharp] (done) | time=0ms
build	15-Jun-2023 18:51:18	INFO: Sensor HTML [web]
build	15-Jun-2023 18:51:18	INFO: Sensor HTML is restricted to changed files only
build	15-Jun-2023 18:51:18	INFO: Sensor HTML [web] (done) | time=2ms
build	15-Jun-2023 18:51:18	INFO: Sensor Text Sensor [text]
build	15-Jun-2023 18:51:18	INFO: Sensor Text Sensor is restricted to changed files only
build	15-Jun-2023 18:51:18	INFO: 1 source file to be analyzed
build	15-Jun-2023 18:51:18	INFO: 1/1 source file has been analyzed
build	15-Jun-2023 18:51:18	INFO: Sensor Text Sensor [text] (done) | time=26ms
build	15-Jun-2023 18:51:18	INFO: Sensor VB.NET Project Type Information [vbnet]
build	15-Jun-2023 18:51:18	INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
build	15-Jun-2023 18:51:18	INFO: Sensor VB.NET Analysis Log [vbnet]
build	15-Jun-2023 18:51:18	INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=11ms
build	15-Jun-2023 18:51:18	INFO: Sensor VB.NET Properties [vbnet]
build	15-Jun-2023 18:51:18	INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
build	15-Jun-2023 18:51:18	INFO: Sensor JaCoCo XML Report Importer [jacoco]
build	15-Jun-2023 18:51:18	INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
build	15-Jun-2023 18:51:18	INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
build	15-Jun-2023 18:51:18	INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
build	15-Jun-2023 18:51:18	INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
build	15-Jun-2023 18:51:18	INFO: javasecurity:S5131 is not activated in quality profile: skipping execution of thymeleaf sensor.
build	15-Jun-2023 18:51:18	INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=0ms
build	15-Jun-2023 18:51:18	INFO: Sensor Serverless configuration file sensor [security]
build	15-Jun-2023 18:51:18	INFO: 0 Serverless function entries were found in the project
build	15-Jun-2023 18:51:18	INFO: 0 Serverless function handlers were kept as entrypoints
build	15-Jun-2023 18:51:18	INFO: Sensor Serverless configuration file sensor [security] (done) | time=3ms
build	15-Jun-2023 18:51:18	INFO: Sensor AWS SAM template file sensor [security]
build	15-Jun-2023 18:51:18	INFO: Sensor AWS SAM template file sensor [security] (done) | time=0ms
build	15-Jun-2023 18:51:18	INFO: Sensor AWS SAM Inline template file sensor [security]
build	15-Jun-2023 18:51:18	INFO: Sensor AWS SAM Inline template file sensor [security] (done) | time=1ms
build	15-Jun-2023 18:51:18	INFO: Sensor CFamily [cpp]
build	15-Jun-2023 18:51:18	INFO: CFamily plugin version: 6.40.0.60596
build	15-Jun-2023 18:51:18	INFO: Using build-wrapper output: /data/bamboo-agent-home/xml-data/build-dir/PRBUILD-PRBUILDCONA3403-CCIC/sonar_build_wrapper/build-wrapper-dump.json
build	15-Jun-2023 18:51:18	INFO: Available processors: 112
build	15-Jun-2023 18:51:18	INFO: Using 4 threads for analysis, according to value of "sonar.cfamily.threads" property.
build	15-Jun-2023 18:51:21	INFO: Loading cache from: server
build	15-Jun-2023 18:51:23	INFO: PCH: unique=0 use=0 (forceInclude=0,throughHeader=0,firstInclude=0) out of 0 (forceInclude=0,throughHeader=0)
build	15-Jun-2023 18:51:23	INFO: SE: 0 out of 0
build	15-Jun-2023 18:51:23	INFO: Z3 refutation rate: 0 out of 0
build	15-Jun-2023 18:51:23	INFO: Subprocess(es) done in 1527ms
build	15-Jun-2023 18:51:23	INFO: 0/1 files marked as unchanged
build	15-Jun-2023 18:51:23	INFO: Cache: 0/0 hits, 125 bytes
build	15-Jun-2023 18:51:23	INFO: 0 compilation units analyzed
build	15-Jun-2023 18:51:23	INFO: ------------------------------------------------------------------------
build	15-Jun-2023 18:51:23	INFO: EXECUTION FAILURE
build	15-Jun-2023 18:51:23	INFO: ------------------------------------------------------------------------
build	15-Jun-2023 18:51:23	INFO: Total time: 14.741s
build	15-Jun-2023 18:51:23	INFO: Final Memory: 43M/456M
build	15-Jun-2023 18:51:23	INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
error	15-Jun-2023 18:51:23	java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
error	15-Jun-2023 18:51:23	  * you are using the latest version of the build-wrapper and the CFamily analyzer
error	15-Jun-2023 18:51:23	  * you are correctly invoking the scanner with correct configuration
error	15-Jun-2023 18:51:23	  * your compiler is supported
error	15-Jun-2023 18:51:23	  * you are wrapping your build correctly
error	15-Jun-2023 18:51:23	  * you are wrapping a full/clean build
error	15-Jun-2023 18:51:23	  * you are providing the path to the correct build-wrapper output directory
error	15-Jun-2023 18:51:23	  * you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps
error	15-Jun-2023 18:51:23		at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:494)
error	15-Jun-2023 18:51:23		at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:215)
error	15-Jun-2023 18:51:23		at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
error	15-Jun-2023 18:51:23		at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
error	15-Jun-2023 18:51:23		at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:64)
error	15-Jun-2023 18:51:23		at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
error	15-Jun-2023 18:51:23		at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
error	15-Jun-2023 18:51:23		at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
error	15-Jun-2023 18:51:23		at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:401)
error	15-Jun-2023 18:51:23		at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:397)
error	15-Jun-2023 18:51:23		at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:366)
error	15-Jun-2023 18:51:23		at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
error	15-Jun-2023 18:51:23		at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
error	15-Jun-2023 18:51:23		at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:135)
error	15-Jun-2023 18:51:23		at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
error	15-Jun-2023 18:51:23		at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
error	15-Jun-2023 18:51:23		at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
error	15-Jun-2023 18:51:23		at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
error	15-Jun-2023 18:51:23		at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
error	15-Jun-2023 18:51:23		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
error	15-Jun-2023 18:51:23		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
error	15-Jun-2023 18:51:23		at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
error	15-Jun-2023 18:51:23		at java.base/java.lang.reflect.Method.invoke(Unknown Source)
error	15-Jun-2023 18:51:23		at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
error	15-Jun-2023 18:51:23		at com.sun.proxy.$Proxy0.execute(Unknown Source)
error	15-Jun-2023 18:51:23		at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
error	15-Jun-2023 18:51:23		at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
error	15-Jun-2023 18:51:23		at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
error	15-Jun-2023 18:51:23		at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
error	15-Jun-2023 18:51:23		at org.sonarsource.scanner.cli.Main.main(Main.java:62)
error	15-Jun-2023 18:51:23	ERROR: 
error	15-Jun-2023 18:51:23	ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

9.8 → 9.9 → 10.0 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.