MSBuild Runner Error

2,048 views
Skip to first unread message

David

unread,
Aug 29, 2016, 4:10:34 PM8/29/16
to SonarQube
Hello,

Please could someone advise why this may occur?

[1] - 18:14:37.994  SonarQube analysis could not be completed because the analysis configuration file could not be found.

[2] - Expected location: d:\***\.sonarqube\conf\SonarQubeAnalysisConfig.xml

[3] - Post-processing failed. Exit code: 1
 

18:14:37.6775117 - [1] - SonarQube Scanner for MSBuild 2.0

18:14:37.7029033 - [2] - Default properties file was found at D:\*****\msbuild\SonarQube.Analysis.xml

18:14:37.7029033 - [3] - Loading analysis properties from D:\***\msbuild\SonarQube.Analysis.xml

18:14:37.7390375 - [4] - Post-processing started.

18:14:37.9939301 - [5] - SonarQube Scanner for MSBuild End Step 2.0

 


(The total path (***) to the SonarQubeAnalysisConfig.xml file is 125 characters)

This has us rather stumped.

Many thanks,

David

duncanp

unread,
Aug 30, 2016, 7:02:41 AM8/30/16
to SonarQube, b...@hotmail.com
The simplest way to produce this error is to run the "begin" and "end" commands from different working directories. The "begin", build and "end" commands all need to be run from the same directory.

(BTW the guidance notes for this group suggest that support questions should be directed to stack overflow).

Regards,
Duncan

David

unread,
Aug 31, 2016, 10:50:20 AM8/31/16
to SonarQube, b...@hotmail.com
Hello Duncan,

Many thanks for your response. The begin, msbuild and end commands do all run from the same directory.

We have discovered this is also caused if the begin step fails.  The output from the begin step reported: "Pre-processing succeeded."  but in fact an exception had been thrown as follows:

12:17:44.16  Generating rulesets...

 

Unhandled Exception: System.Net.WebException: The remote server returned an erro

r: (500) Internal Server Error.

   at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request

)

   at System.Net.WebClient.DownloadString(Uri address)

   at System.Net.WebClient.DownloadString(String address)

   at SonarQube.TeamBuild.PreProcessor.WebClientDownloader.<>c__DisplayClass4_0.

<TryDownloadIfExists>b__0()

   at SonarQube.TeamBuild.PreProcessor.WebClientDownloader.DoIgnoringMissingUrls

(Action op)

   at SonarQube.TeamBuild.PreProcessor.WebClientDownloader.TryDownloadIfExists(S

tring url, String& contents)

   at SonarQube.TeamBuild.PreProcessor.SonarWebService.TryGetProfileExport(Strin

g qualityProfile, String language, String format, String& content)

   at SonarQube.TeamBuild.PreProcessor.Roslyn.RoslynAnalyzerProvider.TryGetRosly

nConfigForProject()

   at SonarQube.TeamBuild.PreProcessor.Roslyn.RoslynAnalyzerProvider.SetupAnalyz

ers(ISonarQubeServer server, TeamBuildSettings settings, String projectKey, Stri

ng projectBranch)

   at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRu

lesets(ProcessedArgs args, TeamBuildSettings settings, IDictionary`2& serverSett

ings, AnalyzerSettings& analyzerSettings)

   at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(Processed

Args args)

   at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.Execute(String[] ar

gs)

   at SonarQube.TeamBuild.PreProcessor.Program.Main(String[] args)

Pre-processing succeeded.


We have resolved the cause but perhaps in the next release the success message might instead say "Pre-processing failed" on exception. so that we can detect this a little easier.

With thanks,

David

David

unread,
Aug 31, 2016, 1:12:43 PM8/31/16
to SonarQube, b...@hotmail.com
Just to add to this, on a repeat analysis the same missing SonarQubeAnalysisConfig.xml file error during the end step occurred however the begin step output this time showed nothing unusual.  

A check of the sonar (test) server log during the begin step had the following:

016.08.31 16:45:52 ERROR web[f.s.s.r.c.c.r.FileLoader] Failed to parse rule files
fr.sii.sonar.report.core.common.exception.ParseException: Failed to parse JSON file
at fr.sii.sonar.report.core.common.parser.JsonParser.parse(JsonParser.java:44) ~[sonar-report-core-2.1.0.jar:na]

This was due to an incompatible plugin on the server.  

However, the msbuild runner output gave no indication that an exception had occurred, reported "Pre-processing succeeded" again and proceeded as normal. Ideally the failure during the call to the server would be reported to the runner so that it could in turn be reported to whatever process was driving the analysis and therefore surfaced to support staff. 

David

anee...@gmail.com

unread,
Jan 27, 2017, 4:04:54 PM1/27/17
to SonarQube, b...@hotmail.com
Hello David,
I know this is slightly older post, but we are in same boat. I wanted to check where is the sonar server log that you mentioned below? Please let me know. thanks.
Reply all
Reply to author
Forward
0 new messages