TFS2017 上 SonarQube 分析超时 [英] Timout on SonarQube Analysis on TFS2017

查看:44
本文介绍了TFS2017 上 SonarQube 分析超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的设置是一个 SonarQube 服务器 5.6.5 LTS 和一个 TFS2017 本地服务器.

Our setup is a SonarQube server 5.6.5 LTS and a TFS2017 on-premise server.

我正在一个大型解决方案上运行代码分析,该解决方案需要大约 15 分钟的时间来构建,大约在同一时间完成分析构建步骤.在完整的 SonarQube 分析"构建步骤中,我收到以下错误:

I'm running Code analysis on a big solution which takes about 15 minutes to build and about the same time to complete the analysis build step. On "Complete SonarQube analysis" build step I get the following error:

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 或者还有其他我应该设置更高的超时设置吗?

The Timeout in the build steps control options are set to zero/infinite. Where can i set SonarQubeAnalysisTimeoutInSeconds or are there any other Timeout settings I should set higher?

如果我在准备构建任务中取消选中在构建摘要中包含完整分析报告",构建将运行绿色.但在这两种情况下,SonarQube 服务器日志中都有一个 OutOfMemoryError:

If I uncheck the "Include full analysis report in the build summary" in the prepare build task, the build runs green. But in both cases there is a OutOfMemoryError in the SonarQube Sever Logs:

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]
...

这两个错误是否相关?

推荐答案

这两个错误相关的.您的构建任务正在等待服务器以构建结果进行响应,并且由于 OutOfMemoryError 而没有响应.

The two errors are correlated. Your build task is waiting for the server to respond with the build results, and it's not responding because of the OutOfMemoryError.

要授予进程更多内存,请编辑 $SONARQUBE_HOME/conf/sonar.properties,取消注释 sonar.ce.javaOpts 行,并根据需要调整值.

To grant the process more memory, edit $SONARQUBE_HOME/conf/sonar.properties, uncomment the sonar.ce.javaOpts line, and adjust the values as needed.

这篇关于TFS2017 上 SonarQube 分析超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆