Build-wrapper-dump.json was generated using old build-wrapper version, which does not match analyzer 6.20.1.32841 version

SonarQube version: 8.9 LTS
CFamily plugin version: 6.20.1.32841
Build Wrapper : we are using latest one which downloaded from : http://URL/static/cpp/build-wrapper-linux-x86.zip

its not at all creating the build-wrapper.log and build-wrapper-dump.json.

Please help us

log:

tns-util-5.1] $ /home/builds/sonarqube/sonar-scanner/bin/sonar-scanner -Dsonar.host.url=http://172.20.40.114:8443 ******** -Dsonar.projectName=TNS-UTIL -Dsonar.projectVersion=1.0 -Dsonar.sourceEncoding=UTF-8 -Dsonar.projectKey=utilsonarqube -Dsonar.cfamily.build-wrapper-output=/home/builds/sonarqube/util -Dsonar.host.url=http://172.20.40.114:8443 -Dsonar.sources=/home/builds/tsd-jenkins-be/nightly-builds/tns-util/tns-util-5.1 -Dsonar.projectBaseDir=/home/builds/tsd-jenkins-be/nightly-builds/tns-util/tns-util-5.1
INFO: Scanner configuration file: /home/builds/sonarqube/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.4.0.2170
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Linux 2.6.32-358.el6.x86_64 amd64
INFO: User cache: /home/builds/.sonar/cache
INFO: Scanner configuration file: /home/builds/sonarqube/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarQube server 8.9.1
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=72ms
INFO: Server id: 86E1FA4D-AXM6S5VMGJfuunVLJ_DZ
INFO: User cache: /home/builds/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=36ms
INFO: Load/download plugins (done) | time=566ms
INFO: Loaded core extensions: developer-scanner
INFO: JavaScript/TypeScript frontend is enabled
INFO: Process project properties
INFO: Process project properties (done) | time=6ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=2ms
INFO: Project key: utilsonarqube
INFO: Base dir: /home/builds/tsd-jenkins-be/nightly-builds/tns-util/tns-util-5.1
INFO: Working dir: /home/builds/tsd-jenkins-be/nightly-builds/tns-util/tns-util-5.1/.scannerwork
INFO: Load project settings for component key: 'utilsonarqube'
INFO: Load project branches
INFO: Load project branches (done) | time=3ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=4ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=1ms
INFO: Auto-configuring with CI 'Jenkins'
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=48ms
INFO: Auto-configuring with CI 'Jenkins'
INFO: Load active rules
INFO: Load active rules (done) | time=963ms
INFO: Indexing files...
INFO: Project configuration:
INFO: 1292 files indexed
INFO: Quality profile for c: Sonar way
INFO: Quality profile for cpp: Sonar way
INFO: ------------- Run sensors on module TNS-UTIL
INFO: JavaScript/TypeScript frontend is enabled
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=15ms
INFO: Sensor CSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [cssfamily] (done) | time=3ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=2ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=7ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=5ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=1ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
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
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=5ms
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=4ms
INFO: Sensor CFamily [cpp]
INFO: CFamily plugin version: 6.20.1.32841
INFO: Using build-wrapper output: /home/builds/sonarqube/util/build-wrapper-dump.json
INFO: Available processors: 8
WARN: 
CFamily plugin supports multithreaded analysis:

* to enable multithreaded analysis
  please specify the number of threads to use
  by setting the following property to your analysis:
  sonar.cfamily.threads=number_of_threads

* if you do not want to enable multithreading
  please explicitly disable it
  by setting the following property to your analysis:
  sonar.cfamily.threads=1

* visit the documentation page for more information
  http://172.20.40.114:8443/documentation/analysis/languages/cfamily/

INFO: Using 1 thread for analysis according to value of "sonar.cfamily.threads" property.
INFO: Load project repositories
INFO: Load project repositories (done) | time=4ms
WARN: 
CFamily plugin supports incremental analysis with the use of a cache:

* if you do not want to enable cache
  please explicitly disable it
  by setting the following property to your analysis:
  sonar.cfamily.cache.enabled=false

* to enable cache please specify the following 2 options:
  sonar.cfamily.cache.enabled=true
  sonar.cfamily.cache.path=relative_or_absolute_path_to_cache_location

* visit the documentation page for more information
  http://172.20.40.114:8443/documentation/analysis/languages/cfamily/

INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 11.297s
INFO: Final Memory: 19M/94M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: java.nio.file.NoSuchFileException: /home/builds/sonarqube/util/build-wrapper-dump.json
	at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:620)
	at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:367)
	at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:175)
	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:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:392)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:388)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:357)
	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:150)
	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)
Caused by: java.nio.file.NoSuchFileException: /home/builds/sonarqube/util/build-wrapper-dump.json
	at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(Unknown Source)
	at java.base/java.nio.file.Files.newByteChannel(Unknown Source)
	at java.base/java.nio.file.Files.newByteChannel(Unknown Source)
	at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(Unknown Source)
	at java.base/java.nio.file.Files.newInputStream(Unknown Source)
	at java.base/java.nio.file.Files.newBufferedReader(Unknown Source)
	at java.base/java.nio.file.Files.newBufferedReader(Unknown Source)
	at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:546)
	... 30 more
ERROR: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Hello @kishore535 ,

Are you wrapping your build with the build-wrapper as described in the documentation?
If so, can you share with me the command you are executing?

Thanks

Thanks for the reply @Amelie , We use in house scripts to execute the scripts, so I merged sonarqube command into the script.
export PATH=$PATH:/home/builds/sonarqube/util/build-wrapper-linux-x86

if [ “$BUILD_TYPE” == “sonar” ]; then
PrintBanner “Generating Sonar Report”
LocalCommand “build-wrapper-linux-x86-64 --out-dir build_output make HIDE_COMMANDS=NO $MAKEOPTS cppcheck” 2
fi

Hello @kishore535

In your second post:

Whereas in your first post:

This is not consistent as written in the documentation. The out-dir (so build_output in your case) is where the build-wrapper.json will be created. It is this directory that you need to give to the sonar-scanner command.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.