簡體   English   中英

關於TFS2017的SonarQube分析的Timout

[英]Timout on SonarQube Analysis on TFS2017

我們的設置是SonarQube服務器5.6.5 LTS和TFS2017內部部署服務器。

我正在對一個大型解決方案運行代碼分析,這個解決方案需要大約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或者是否有任何其他Timeout設置我應該設置更高?

如果我在准備構建任務中取消選中“在構建摘要中包含完整分析報告”,則構建將運行為綠色。 但在這兩種情況下,SonarQube服務器日志中都存在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個錯誤是否相關?

這兩個錯誤相關的。 您的構建任務正在等待服務器響應構建結果,並且由於OutOfMemoryError而沒有響應。

要為進程授予更多內存,請編輯$SONARQUBE_HOME/conf/sonar.properties ,取消注釋sonar.ce.javaOpts行,並根據需要調整值。

我們在SQ版本6.4和SonarQube TFS擴展版本SonarSource.sonarqube-3.0.2中沒有這個問題。 但是我們剛剛升級到SQ v7.0並開始遇到這個問題。

即使在設置構建變量“SonarQubeAnalysisTimeoutInSeconds”之后,也無法正常工作。

錯誤SonarQubeAnalysisTimeoutInSeconds設置為600,將用於輪詢SonarQube任務完成。 分析未在600秒的分配時間內完成。 考慮將構建變量SonarQubeAnalysisTimeoutInSeconds設置為更高的值。

此致,San

暫無
暫無

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

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