簡體   English   中英

TFS2017的401未經授權的Sonarqube分析

[英]401 Unauthorized Sonarqube Analysis with TFS2017

我設置了SonarQube服務器並將BuildTask步驟包括在TFS2017生成過程中。 TFS是一種本地設置。

在“ Complete SonarQube analysis”構建步驟中,出現以下錯誤:

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之后進行的某種日志記錄。

Build Agent安裝在服務器A上,SonarQube安裝在服務器B上。“准備步驟”構建任務完成且沒有錯誤,因此我認為基本的SonarQube安裝程序正常。 我安裝了SonarQube 5.6.5 LTS,並且SonarQube中提供了Sonar用戶.Analysis.xml是默認的admin / admin用戶。

有什么建議么?

構建任務不使用SonarQube.Analysis.xml中的身份驗證屬性,您需要在TFS的SonarQube端點中指定身份驗證令牌: https ://docs.sonarqube.org/display/SCAN/SonarQube+Endpoint

以下是有關如何從SonarQube獲取令牌的文章: https ://docs.sonarqube.org/display/SONAR/User+Token

如果您首先沒有評論注釋,請不要忘記在SonarQube.Analysis.xml中再次評論sonar.login和sonar.password屬性。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM