2017-01-30 5 views
1

私はSonarQubeサーバーをセットアップし、TFS2017ビルドプロセスにBuildTaskステップを組み込みました。 TFSはオンプレミスのセットアップです。オン401 TFS2017による不正なSonarqube解析

私は次のエラーを取得する「完全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によって行わログのいくつかの種類であると仮定します。

ビルドエージェントはサーバーBにインストールされたサーバーAにインストールされています。「準備ステップ」ビルドタスクはエラーなしで終了するので、基本的なSonarQubeセットアップはOKです。私はSonarQube 5.6.5 LTSをインストールしました.SonarQube.Analysis.xmlで提供されるSonar Userはデフォルトのadmin/adminユーザーです。

提案がありますか?

答えて

2

ビルドタスクを使用すると、TFSにおけるSonarQubeエンドポイントに認証トークンを指定する必要があり、SonarQube.Analysis.xmlでの認証プロパティを使用しません: https://docs.sonarqube.org/display/SCAN/SonarQube+Endpoint

そしてここでは、入手方法についての記事ですSonarQubeからトークン: https://docs.sonarqube.org/display/SONAR/User+Token

いけない」あなたが最初の場所でそれらをコメント解除場合SonarQube.Analysis.xmlに再びsonar.loginとsonar.passwordプロパティをコメントすることを忘れています。

+0

あなたの返事のためにThx、それはうまくいった - 私はSonarQube.Analysis.xmlのsonar.loginとsonar.passwordプロパティをコメントするのを忘れていたが、最初に成功しなかった。私はこれをあなたの答えに加えます。 – phifi

+0

コメントをありがとう:)私はバグトラッカーに新しい問題を追加し、XMLからログイン/パスワードのプロパティを削除する必要があります。 –

+0

お役立ち情報公開されている場合は、ここにリンクを張って問題を追跡することができます。また、私は私のsonarqubeセットアップに別の問題を抱えています[ここ](http://stackoverflow.com/questions/41953929/timout-on-sonarqube-analysis-on-tfs2017)。あなたの助けが大いに評価されるでしょう:) – phifi

関連する問題