2017-01-31 24 views
0

私たちのセットアップはSonarQubeサーバー5.6.5 LTSとTFS2017オンプレミスサーバーです。TFS2017でのSonarQube解析のタイムアウト

ビルドに約15分、分析ビルドのステップを完了するのにほぼ同じ時間がかかる大きなソリューションでコード分析を実行しています。 「完全SonarQube分析」私は次のエラーを取得するステップを構築する上で :

2017-01-31T08:52:44.8355200Z 09:52:44.741 Post-processing succeeded. 
2017-01-31T08:52:46.9293440Z Waiting on the SonarQube server to finish processing in order to determine the quality gate status. 
2017-01-31T08:57:47.7364532Z ##[error]System.Management.Automation.RuntimeException: The analysis did not complete in the allotted time of 300 seconds. Consider setting the build variable SonarQubeAnalysisTimeoutInSeconds to a higher value. ---> System.Management.Automation.RuntimeException: The analysis did not complete in the allotted time of 300 seconds. Consider setting the build variable SonarQubeAnalysisTimeoutInSeconds to a higher value. 
2017-01-31T08:57:47.7364532Z --- Ende der internen Ausnahmestapelüberwachung --- 
2017-01-31T08:57:47.7364532Z bei System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) 
2017-01-31T08:57:47.7364532Z bei System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) 
2017-01-31T08:57:47.7364532Z bei System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) 
2017-01-31T08:57:47.7364532Z bei System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings) 
2017-01-31T08:57:47.7364532Z bei System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings) 
2017-01-31T08:57:47.7364532Z bei Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(String[] args) 
2017-01-31T08:57:47.7676884Z ##[error]LegacyVSTSPowerShellHost.exe completed with return code: -1. 
2017-01-31T08:57:47.7676884Z ##[section]Finishing: Complete the SonarQube analysis 

ビルド手順制御オプションでタイムアウトをゼロ/無限に設定されています。どこでSonarQubeAnalysisTimeoutInSecondsを設定することができますか、それ以上設定する必要がある他のタイムアウト設定はありますか?

ビルド準備タスクの「ビルドサマリーに完全な分析レポートを含める」のチェックを外すと、ビルドは緑色になります。 しかし、どちらの場合もSonarQube SeverのログでOutOfMemoryErrorがあります:

2017.01.31 09:54:10 INFO [o.s.s.c.s.ComputationStepExecutor] Compute duplication measures | time=399ms 
2017.01.31 09:54:56 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVnzuYyFhG9cSXnted2v 
java.lang.OutOfMemoryError: Java heap space 
    at java.util.Arrays.copyOf(Unknown Source) ~[na:1.8.0_121] 
    at java.lang.AbstractStringBuilder.ensureCapacityInternal(Unknown Source) ~[na:1.8.0_121] 
    at java.lang.AbstractStringBuilder.append(Unknown Source) ~[na:1.8.0_121] 
    at java.lang.StringBuilder.append(Unknown Source) ~[na:1.8.0_121] 
    at org.sonar.server.computation.step.DuplicationDataMeasuresStep$DuplicationVisitor.appendDuplication(DuplicationDataMeasuresStep.java:131) ~[sonar-server-5.6.5.jar:na] 
... 

は相関がこれらの2つのエラーはありますか?

+2

「完全な分析レポートをビルドサマリーに含める」チェックボックスをオンにすると、タスクは分析が完了するのを待ってから次のタスクに進みます。これはビルドレポートに品質のゲートステータスを入れたいが、ビルドを遅くする場合に便利です。サーバー上のSonarQubeプロセスで使用可能なメモリは何ですか? SonarQubeのパフォーマンスの詳細については、[システム要件]ページ(https://docs.sonarqube.org/display/SONAR/Requirements)を参照してください。 –

+0

私は前にこのページを知っていました。サーバー上に4GBのメモリがあるので、私はjavaOptsプロパティの設定には気を付けませんでした。これらの値を明示的に2GB Xmxと512mb XMSに設定しました。今はすべて問題ありません。 – phifi

答えて

2

この2つのエラーは、です。ビルドタスクはサーバーがビルド結果で応答するのを待機しており、OutOfMemoryErrorのため応答しません。

プロセスにメモリを追加するには、$SONARQUBE_HOME/conf/sonar.propertiesを編集し、sonar.ce.javaOpts行のコメントを解除し、必要に応じて値を調整します。

+1

それはちょっと明白ですが、SonarQubeサーバーインスタンスを再設定した後で再起動することを忘れないでください。もう1時間半ほどかかります... – phifi

関連する問題