ERROR: Error during SonarScanner execution after upgrading to Sonarqube 8.9LTS

Sonarqube 8.9.9
Scanner for msbuild: 5.7.2

We are trying to scan the C# code in teamcity. But we are facing the below error:

10:24:14     at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
10:24:14     at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
10:24:14     at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
10:24:14     at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
10:24:14     at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
10:24:14     at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
10:24:14     at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
10:24:14     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
10:24:14     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
10:24:14     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
10:24:14     at java.lang.reflect.Method.invoke(Method.java:497)
10:24:14     at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
10:24:14     at com.sun.proxy.$Proxy0.execute(Unknown Source)
10:24:14     at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
10:24:14     at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
10:24:14     at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
10:24:14     at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
10:24:14     at org.sonarsource.scanner.cli.Main.main(Main.java:61)
10:24:14   ERROR:
10:24:14   The SonarScanner did not complete successfully
10:24:14   09:24:14.24  Post-processing failed. Exit code: 1
10:24:14   Process exited with code 1

This is our teamcity configuration of sonar scanner:

teamcity build logs:

sonarscanner begin logs:

Step 2/13: Sonar: Start analysis (SonarScanner for MSBuild: begin analysis) (3s)
[10:12:21] :	 [Step 2/13] Starting: E:\TCBuildAgent2\tools\sonar-scanner-msbuild.5.7.1.49528-net46\SonarScanner.MSBuild.exe "/d:project.home=." "/d:sonar.host.url=http://sonar.europe.easyjet.local" "/k:B2B" "/n:B2B" "/v:224.0.6105-EECA-32539" "/d:sonar.login=11fd7fd76afa23711ea1b5e9418761b478d0f09f" /d:sonar.cs.dotcover.reportsPaths="E:\TCBuildAgent2\temp\buildTmp"\dotCover.html "/d:sonar.resharper.cs.reportPath=InspectionResults.xml " /d:sonar.resharper.solutionFile=easyjet.b2b.sln begin
[10:12:21] :	 [Step 2/13] in directory: E:\TCBuildAgent2\work\a3eb9d4fb22f8f0d
[10:12:21] :	 [Step 2/13] SonarScanner for MSBuild 5.7.1
[10:12:21] :	 [Step 2/13] Using the .NET Framework version of the Scanner for MSBuild
[10:12:21] :	 [Step 2/13] Pre-processing started.
[10:12:21] :	 [Step 2/13] Preparing working directories...
[10:12:22] :	 [Step 2/13] 09:12:22  Updating build integration targets...
[10:12:22] :	 [Step 2/13] 09:12:22.412  Fetching analysis configuration settings...
[10:12:22] :	 [Step 2/13] 09:12:22.862  Provisioning analyzer assemblies for cs...
[10:12:22] :	 [Step 2/13] 09:12:22.864  Installing required Roslyn analyzers...
[10:12:23] :	 [Step 2/13] 09:12:23.881  Provisioning analyzer assemblies for vbnet...
[10:12:23] :	 [Step 2/13] 09:12:23.884  Installing required Roslyn analyzers...
[10:12:23] :	 [Step 2/13] 09:12:23.939  Pre-processing succeeded.
[10:12:23] :	 [Step 2/13] Process exited with code 0

sonarscanner end logs where shows the error:

SonarScanner end logs.log (46.9 KB)

This error is happening after upgrading to sonarqube 8.9.9 LTS
Please anyone help on this

Thanks in advance

Hello @vignesh.suresh ,

Welcome to Sonar Community :sonar:

Thanks for the logs. I see this error:

[10:24:13] :	 [Step 7/13] INFO: Sensor FxCop (cs) [fxcop]
[10:24:13] :	 [Step 7/13] INFO: Base Dir: E:\TCBuildAgent2\work\a3eb9d4fb22f8f0d\EJ.Inventory.CancelBookingRequest
[10:24:13] :	 [Step 7/13] INFO: sonar.dotnet.visualstudio.solution.file not set
[10:24:13] :	 [Step 7/13] WARN: FxCop plugin missed the definition of what to scan. Please set one of folowing properties:sonar.cs.fxcop.assembly, sonar.cs.fxcop.project, sonar.cs.fxcop.reportPath or sonar.cs.fxcop.slnFile
[10:24:13] :	 [Step 7/13] WARN: Use default sln file found: E:\TCBuildAgent2\work\a3eb9d4fb22f8f0d\easyjet.b2b.sln
[10:24:13] :	 [Step 7/13] INFO: ------------------------------------------------------------------------
[10:24:13] :	 [Step 7/13] INFO: EXECUTION FAILURE
[10:24:13] :	 [Step 7/13] INFO: ------------------------------------------------------------------------
[10:24:13] :	 [Step 7/13] INFO: Total time: 18.280s
[10:24:14] :	 [Step 7/13] INFO: Final Memory: 21M/327M
[10:24:14] :	 [Step 7/13] INFO: ------------------------------------------------------------------------
[10:24:14]W:	 [Step 7/13] ERROR: Error during SonarScanner execution
[10:24:14]W:	 [Step 7/13] java.lang.NoSuchMethodError: org.sonar.api.config.Settings.appendProperty(Ljava/lang/String;Ljava/lang/String;)Lorg/sonar/api/config/Settings;
[10:24:14]W:	 [Step 7/13] 	at org.sonar.plugins.fxcop.FxCopConfiguration.checkScanProperties(FxCopConfiguration.java:134)
[10:24:14]W:	 [Step 7/13] 	at org.sonar.plugins.fxcop.FxCopConfiguration.checkProperties(FxCopConfiguration.java:124)
[10:24:14]W:	 [Step 7/13] 	at org.sonar.plugins.fxcop.FxCopSensor.executeImpl(FxCopSensor.java:79)
[10:24:14]W:	 [Step 7/13] 	at org.sonar.plugins.fxcop.FxCopSensor.execute(FxCopSensor.java:73)

It looks like you are using the FxCop, which doesn’t look like it has been updated recently. Last official release was from 2018. It looks like the plugin is not fulfilling requirements of the Sonar Plugin API and thus it is failing.

I suggest you reach out to the maintainers of the FxCop project or considering using other analyzers such as FxCop code analysis (binary analysis) and .NET analyzers (source analysis) - Visual Studio (Windows) | Microsoft Docs.

For now, I would remove that plugin unless you really need it.

Hi Joe

  1. How to do the above steps?
  2. And one more thing is am getting the same error for nodejs project which is mostly doesn’t need a FXCop throws the above error!!!

Hi @vignesh.suresh ,

To remove the plugin, you need to delete or move it out of the $SQ_HOME/extensions/plugins folder and restart SonarQube.