【发布时间】:2017-06-15 09:58:18
【问题描述】:
我设置了一个 SonarQube 服务器,并将 BuildTask 步骤包含在 TFS2017 构建过程中。 TFS 是一种本地设置。
在“完成 SonarQube 分析”构建步骤中,我收到以下错误:
2017-01-30T08:54:30.7388183Z 09:54:30.676 Post-processing succeeded.
2017-01-30T08:54:32.1607278Z ##[error]System.Management.Automation.CmdletInvocationException: {"err_code":401,"err_msg":"Unauthorized"} ---> System.Net.WebException: Der Remoteserver hat einen Fehler zurückgegeben: (401) Nicht autorisiert.
2017-01-30T08:54:32.1607278Z bei Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
2017-01-30T08:54:32.1607278Z bei Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
2017-01-30T08:54:32.1607278Z --- Ende der internen Ausnahmestapelüberwachung ---
2017-01-30T08:54:32.1607278Z bei System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
2017-01-30T08:54:32.1607278Z bei System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
2017-01-30T08:54:32.1607278Z bei System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
2017-01-30T08:54:32.1607278Z bei System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2017-01-30T08:54:32.1607278Z bei System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2017-01-30T08:54:32.1607278Z bei Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(String[] args)
2017-01-30T08:54:32.1763500Z ##[error]LegacyVSTSPowerShellHost.exe completed with return code: -1.
2017-01-30T08:54:32.1763500Z ##[section]Finishing: Complete the SonarQube analysis
分析完成后,我假设这是 SonarQube 之后完成的某种日志记录。
构建代理安装在服务器 A 上,SonarQube 安装在服务器 B 上。“准备步骤”构建任务完成没有错误,所以我假设基本的 SonarQube 设置是好的。我安装了 SonarQube 5.6.5 LTS,SonarQube.Analysis.xml 中提供的 Sonar User 是默认的 admin/admin 用户。
有什么建议吗?
【问题讨论】: