声纳qube开始任务失败 - 从批处理文件收到意外的退出代码:-532462766

时间:2017-04-14 23:42:21

标签: sonarqube

我在tfs构建任务中启动声纳分析时遇到错误。 请帮助!

*************************************************************************

Starting task: Fetch the Quality Profile from SonarQube

****************************************************************************** 
Executing the powershell script: 

D:\kannappan_sonar\tasks\SonarQubePreBuild\1.0.35\SonarQubePreBuild.ps1 SonarQube Scanner for MSBuild 1.1 
Default properties file was found at D:\kannappan_sonar\tasks\SonarQubePreBuild\1.0.35\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml 
Loading analysis properties from D:\kannappan_sonar\tasks\SonarQubePreBuild\1.0.35\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml 
Pre-processing started. 
Preparing working directories... 
Checking for updates...

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, String projectBranch)
    at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ISonarQubeServer server, ProcessedArgs args, TeamBuildSettings settings, IDictionary`2& serverSettings, List`1& analyzersSettings)
    at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs args)
    at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.Execute(String[] args)
    at SonarQube.TeamBuild.PreProcessor.Program.Main(String[] args) SonarQube Scanner for MSBuild Begin Step 2.2 18:11:45.209  Loading analysis properties from D:\kannappan_sonar\tasks\SonarQubePreBuild\1.0.35\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml 18:11:45.271  Updating build integration targets... 18:11:45.286  Fetching analysis configuration settings... Pre-processing succeeded.
    Unexpected exit code received from batch file: -532462766

1 个答案:

答案 0 :(得分:1)

此错误的关键是:The remote server returned an error: (401) Unauthorized

您可能正在尝试分析权限受限的项目。在开始和结束步骤中,您需要从具有分析项目权限的帐户传递analysis token