Switch to Sonar 9 with compile-commands: still finds the old build-wrapper setting

Hi,

I am trying to switch to Sonar 9.5. I dropped the sonar.cfamily.build-wrapper-output setting from my sonar-project.properties, deleted the sonar cache and the repository, checked everything out again and still get the following output when running the sonar scanner (4.7.0.2747) with -X:

09:44:32.265 DEBUG: 0 SAM template configuration files were found in the project. 0 SAM function entries were found in total. 0 were kept as potential entrypoints.
09:44:32.268 INFO: Sensor AWS SAM template file sensor [security] (done) | time=15ms
09:44:32.269 INFO: Sensor CFamily [cpp]
09:44:32.276 INFO: CFamily plugin version: 6.34.0.48468
09:44:32.297 ERROR:

One configuration property is expected, two were found:
  "sonar.cfamily.build-wrapper-output"
  "sonar.cfamily.compile-commands"


09:44:46.539 INFO: ------------------------------------------------------------------------
09:44:46.540 INFO: EXECUTION FAILURE
09:44:46.542 INFO: ------------------------------------------------------------------------
09:44:46.543 INFO: Total time: 2:49.426s
09:44:46.701 INFO: Final Memory: 40M/110M
09:44:46.702 INFO: ------------------------------------------------------------------------
09:44:46.703 ERROR: Error during SonarScanner execution
java.lang.UnsupportedOperationException:

One configuration property is expected, two were found:
  "sonar.cfamily.build-wrapper-output"
  "sonar.cfamily.compile-commands"


        at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:267)
        at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:203)
        at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
        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.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:81)
        at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
        at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
        at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:392)
        at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:388)
        at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:357)
        at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
        at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
        at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:135)
        at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
        at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
        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)

The only cfamily settings in my sonar-project.properties are:

sonar.cfamily.cpp20=true
sonar.cfamily.threads=4
sonar.cfamily.compile-commands=build/compile_commands.json
sonar.cfamily.cache.enabled=true
sonar.cfamily.cache.path=sonar-cache

As you can see, the c plugin gets loaded and without telling me the files it is loading or where it is getting its config from, it just crashes. In the beginning of the log, it says

09:41:57.208 INFO: Scanner configuration file: C:\Jenkins\sonar-scanner\bin\..\conf\sonar-scanner.properties
09:41:57.244 INFO: Project root configuration file: C:\Jenkins\workspace\fms-app\sonar-project.properties

But neither file contains any build wrapper config. How can I fix this? Where could the build-wrapper-output config come from?

Hi,

Can you share the very first line of your analysis log, where you actually fire the analysis command?

 
Ann

Absolutely, it’s nothing special :smiley:

C:\Jenkins\workspace\fms-app>C:\\Jenkins\\sonar-scanner\\bin\\sonar-scanner.bat -X
09:41:57.208 INFO: Scanner configuration file: C:\Jenkins\sonar-scanner\bin\..\conf\sonar-scanner.properties

Hi,

Thanks for sharing. I’ll be honest and tell you I was hoping you’d forgotten that the build-wrapper switch was in your command line. :joy:

And at this point, I’m over my head, so I’m going to flag this for the language experts.

 
Ann

:joy: :joy: haha, nice idea :stuck_out_tongue_winking_eye: I wished it was that easy. I even grepped the whole repository for that string and found no matches… thanks for passing it on.

Just an idea: Is this configured in the project settings on SonarQube UI?

1 Like

YES! It was :zipper_mouth_face: thanks a lot! I am sure it’ll work now :yum:

1 Like

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