尝试在TFS Online上使用SonarQube时出现错误。 它在处理过程中超时。 我更改了sonar.properties文件并重新启动了服务。 但是我仍然得到一个错误,说它超时,因为它没有在300秒内完成。 我甚至试图扩大服务器,给它更多的权力。 我目前在Azure的D2_V2下。
sonar.jdbc.maxWait=900000
2017-03-11T20:12:34.4141248Z Waiting on the SonarQube server to finish processing in order to determine the quality gate status. 2017-03-11T20:12:34.4141248Z 2017-03-11T20:12:34.4141248Z 2017-03-11T20:17:34.7999965Z ##[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-03-11T20:17:34.7999965Z --- End of inner exception stack trace --- 2017-03-11T20:17:34.7999965Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) 2017-03-11T20:17:34.7999965Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) 2017-03-11T20:17:34.8009662Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) 2017-03-11T20:17:34.8009662Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings) 2017-03-11T20:17:34.8009662Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings) 2017-03-11T20:17:34.8009662Z at Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(String[] args) 2017-03-11T20:17:34.8109668Z ##[error]LegacyVSTSPowerShellHost.exe completed with return code: -1. 2017-03-11T20:17:34.8109668Z ##[section]Finishing: Complete the SonarQube analysis
正如错误信息所示:
分析没有在300秒的分配时间内完成。 考虑将生成变量
SonarQubeAnalysisTimeoutInSeconds
设置为更高的值
转到构建定义中的变量选项卡,添加上面提到的变量,然后增加值。