mloomis
mloomis

Reputation: 199

SonarQube Msbuild Runner and Jenkins Unauthorized Error

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.

Upvotes: 1

Views: 2780

Answers (1)

Jeroen Heier
Jeroen Heier

Reputation: 3684

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

Upvotes: 3

Related Questions