2

Unable to execute sonar run for ms build when i change the sonar host from localhost to my machine ip.

tried changing the host in sonar.properties file and also in sonarqube_analysis.xml.

c:\HID\project-test\PACS\sonar_opencover\Project>MSBuild.SonarQube.Runner.exe end
Default properties file was found at C:\HID\project-test\dotnet\MSBuild.SonarQube.Runner-1.0.1\SonarQube.Analysis.xml
Loading analysis properties from C:\HID\project-test\dotnet\MSBuild.SonarQube.Runner-1.0.1\SonarQube.Analysis.xml
Post-processing started.
Execution failed. The specified executable does not exist: c:\HID\project-test\PACS\sonar_opencover\Project\.sonarqube\bin\MSBuild.SonarQube.Internal.PostProcess.exe
Post-processing failed. Exit code: 1

Scripts i executed

@call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"
MSBuild.SonarQube.Runner.exe begin /k:"jenkins_test5" /n:"jenkins_test5" /v:"1.0" /d:sonar.cs.opencover.reportsPaths="%CD%\opencover.xml"
msbuild.exe
"C:\HID\project-test\PACS\sonar_opencover\opencover.4.6.210\OpenCover.Console.exe" -output:"%CD%\opencover.xml" -register:user -target:"vstest.console.exe" -targetargs:"UnitTestProject1\bin\Debug\UnitTestProject1.dll"
MSBuild.SonarQube.Runner.exe end
divakar.scm
  • 1,256
  • 5
  • 21
  • 32

2 Answers2

1

I ran into this issue today. Turns out that I had miss configured SonarQube.Analysis.xml. Essentially, it expects

<Property Name="sonar.host.url">http://{server}:9000/sonar</Property>

including /sonar (which comes from sonar.web.context setting of sonar.properties on the server).

I had missed out /sonar in SonarQube.Analysis.xml and had exact same symptom as yours.

WiSeeker
  • 812
  • 9
  • 24
0

I have this error because the sonarcube url is wrong, it can't connect to the conarcube host:

<Property Name="sonar.host.url">http://{server}:{Port}</Property>

After asking my colleague I found that the url has changed, I correct the url and it works succesfully.

yu yang Jian
  • 6,680
  • 7
  • 55
  • 80