SonarQube Msbuild Runner and Jenkins Unauthorized Error

和自甴很熟 提交于 2019-12-11 11:18:01

问题


I am getting the following error when trying to run Sonarqube MSBuild Runner with Jenkins. I am using SonarQube 4.5 and MSBuild SonarQube Runner 1.1. Any suggestions on how to resolve?

Unhandled Exception: System.Net.WebException: The remote server returned an error: (401) Unauthorized.
   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.Download(String url)
   at SonarQube.TeamBuild.PreProcessor.SonarWebService.GetProperties(String projectKey)
   at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ProcessedArgs args, TeamBuildSettings settings, ILogger logger, IDictionary`2& serverSettings)
   at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs args, ILogger logger)
   at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.Execute(String[] args, ILogger logger)
   at SonarQube.TeamBuild.PreProcessor.Program.Main(String[] args)
Pre-processing succeeded.

回答1:


You need to look at the configuration file SonarQube.Analysis.xml. Confirm that the property sonar.host.url is correct and you have configured a valid sonar.login and sonar.password. The user you specified must be able to execute analysis. Open the SonarQube portal as admin and activate Administration - Security - Global Permissions. The user must be specified in Execute Analysis or must be a member of a group specified in Execute Analysis. Provide more details if this does not help



来源:https://stackoverflow.com/questions/35514223/sonarqube-msbuild-runner-and-jenkins-unauthorized-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!