SonarQube analysis could not be completed because the analysis configuration file could not be found
Asked Answered
H

5

14

SonarQube is giving me below error when i integrate the xamarin app with jenkins on windows sever

SonarQube Scanner for MSBuild 3.0
Default properties file was found at C:\SonarQube\bin\SonarQube.Analysis.xml
Loading analysis properties from C:\SonarQube\bin\SonarQube.Analysis.xml
Post-processing started.
13:49:43.952  SonarQube analysis could not be completed because the analysis configuration file could not be found: C:\Users\Administrator\.jenkins\workspace\Xamarin-ProjectTemplate\.sonarqube\conf\SonarQubeAnalysisConfig.xml.
13:49:43.952  Post-processing failed. Exit code: 1

I have followed the below guide https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild

SonarQube.Scanner.MSBuild.exe begin /k:"org.sonarqube:sonarqube-scanner-msbuild" /n:"Project Name" /v:"1.0"
MSBuild.exe /t:Rebuild
SonarQube.Scanner.MSBuild.exe end

Please help me to resolve this issue

Hochman answered 19/7, 2017 at 14:0 Comment(2)
I had the same error...in order to make it work, instead of MSBuild.exe /t:Rebuild, you just need to use MSBuild.exeTapis
@Hackerman, maybe you are right, but there are much more reasons for the same error e ("SonarQube analysis could not be completed...").Falmouth
C
15

The errors reported at the end of a SonarQube report are sometimes less helpful than the errors when you begin.

Eg when I got this error, scrolling to the top of the log showed that I wasn't correctly setting the sonar.projectKey value, but this message the OP shared is still what showed up at the end.

Caribbean answered 20/3, 2019 at 19:18 Comment(2)
this helped me. I found this error near the top: "Invalid project key. Allowed characters are alphanumeric, '-', '_', '.' and ':', with at least one non-digit."Ensiform
Right on point! In my case it was expired access token, also mentioned only in the few first lines.Thornburg
I
2

I had the same problem. You need find correct MSBuild.exe.

I have several in c:\Windows\Microsoft.NET\Framework64\... and also in c:\Program Files (x86) For my project in Visual Studio 2017 with .NETFramework,Version=v4.6.1 the correct MSBuild.exe is:

"c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\MSBuild.exe"  /t:Rebuild

For the Enterpsie version is should be:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild" /t:Rebuild
Interrogatory answered 24/6, 2018 at 0:32 Comment(1)
The error message "SonarQube analysis could not be completed..." is a kind of summary, unfortunately, a misleading summary. The REAL reason is usually at the beginning of the log. Your answer is too specific to be applied in this case.Falmouth
L
0

I got the same error and was able to fix it by excluding "/t:Rebuild" from second step. Also used the VS2017 MSBuild.exe

These are the 3 commands I ran in Windows Command Prompt (CMD):

1>> SonarScanner.MSBuild.exe begin /k:"MyProjectName"

2>> "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/MSBuild/15.0/Bin/MSBuild.exe" "MySolution.sln" 

3>> SonarScanner.MSBuild.exe end
Linstock answered 3/6, 2019 at 19:8 Comment(1)
This is not a good answer, @Natasha Voloshyna, if it helped you that was rather accidental, it's so called "false positive". The error message "SonarQube analysis could not be completed..." is a kind of summary, unfortunately, a misleading summary. The REAL reason is usually at the beginning of the log.Falmouth
S
0

Update I confront this error also , my solution was easy I just build the project in the visual studio then its succeeded.

Selfloading answered 18/10, 2022 at 8:45 Comment(0)
R
-1

I had this problem because I used a bad project key (it had a }) inside. I removed the }and the problem was gone.

Rasberry answered 15/5, 2020 at 21:21 Comment(1)
Possible answers of that kind can be plenty. The error message "SonarQube analysis could not be completed..." is a kind of summary, unfortunately, a misleading summary. The REAL reason is usually at the beginning of the log. Your answer is too specific to be applied in this case.Falmouth

© 2022 - 2025 — McMap. All rights reserved.