SonarQube 6.7.4 Post-processing failed. Exit code: 1

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube 6.7.4 and Scanner 4.3.1 & 4.7.1
  • what are you trying to achieve
    I am trying to run an analysis on some code
  • what have you tried so far to achieve this
    I have uninstalled the dotnet-sonarscanner version 4.3.1 and installed 4.7.1.

Hello,

I am getting the following error:

SonarScanner for MSBuild 4.3.1

Using the .NET Core version of the Scanner for MSBuild

Default properties file was found at C:\Users\Test\.dotnet\tools\.store\dotnet -sonarscanner \4.3.1\dotnet -sonarscanner \4.3.1\tools\netcoreapp2.1\any\SonarQube.Analysis.xml

Loading analysis properties from C:\Users\Test\.dotnet\tools\.store\dotnet -sonarscanner \4.3.1\dotnet -sonarscanner \4.3.1\tools\netcoreapp2.1\any\SonarQube.Analysis.xml

Post -processing started.

The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.

Possible causes:

   1. The project has not been built - the project must be built in between the begin and end steps

   2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0 and 15.0 are supported

   3. The begin, build and end steps have not all been launched from the same folder

   4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)

Generation of the sonar -properties file failed. Unable to complete SonarQube analysis.

10:53:27.238  Creating a summary markdown file...

10:53:27.242  Post -processing failed. Exit code: 1

I upgraded to .Net Core 3.1 and I think the issue is the version of SonarQube but I would like to verify. I also did try upgrading to the dotnet-scanner version 4.7.1 tool, but it did not help.

So I have the following questions regarding the issue:

*Up to what version of MSBuild is supported in SonarQube 6.7.4?

*Where in the docs do I find what versions of MSBuild are supported?

*Are the dotnet-scanner versions backwards compatible?

Thank you in advance!

Hi @mberrueta

Please find the answers below:

The Sonar Scanner for MSBuild requires your project to be built with MSBuild 14.0+. We recommend installing Visual Studio 2015 update 3 or later on the analysis machine in order to benefit from the integration and features provided with the Visual Studio ecosystem (VSTest, MSTest unit tests, etc.).

https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-msbuild/

Yes, they should be. At least 4.7.1 is compatible with SQ 6.7+.

Have you explored the possible causes from the message? This usually happens when the begin or build steps are not run.

If the problem was not solved in the meantime could you please check if a .sonarqube folder was generated during the analysis and attach to this issue the folder as a zip?

Thank you,
Costin

Hello @costin.zaharia,

I appreciate the reply!

I can confirm that the .sonarqube directory is being generated. I cannot attach a zip as it will only let me uploaded pictures or .txt files. Is there another way to attach it? Or another way to send it to you?

So here is how I am running the command:
dotnet sonarscanner begin /k:"TroubleShoot_Test_Core_2.1.602" /d:sonar.host.url=https://sonarqube.internal.com”`

I get the following output:
SonarScanner for MSBuild 4.7.1
Using the .NET Core version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories…
10:15:06.667 Updating build integration targets…
10:15:06.7 Fetching analysis configuration settings…
10:15:07.455 Provisioning analyzer assemblies for cs…
10:15:07.458 Installing required Roslyn analyzers…
10:15:07.696 Pre-processing succeeded.

Then I try the end command:
dotnet sonarscanner end

With the following output:
SonarScanner for MSBuild 4.7.1
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:
1. The project has not been built - the project must be built in between the begin and end steps
2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
3. The begin, build and end steps have not all been launched from the same folder
4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
10:18:49.994 Post-processing failed. Exit code: 1

Hi @mberrueta,

Between the begin step and the end one do you build the project? Does the build completes successfully?

Thank you,
Costin

A post was split to a new topic: Scanner for MSBuild unable to collect information for C#

Hi,

Thanks for Creating the new topic on behalf of me.

I am not able to reply from the newly created topic. I cannot see the Reply button on that.https://community.sonarsource.com/t/scanner-for-msbuild-unable-to-collect-information-for-c/26624
Thank You,
Sanket Vyas

@Sanket_Vyas double-check you are logged in, and try again (I’ve move the post to a more specific forum, which might make a difference).

If that doesn’t work, create a new thread and I will reply to that.