【问题标题】:SonarQube MSBuild End Analysis Failure - Expected X to be a parent of YSonarQube MSBuild 结束分析失败 - 预期 X 是 Y 的父级
【发布时间】:2017-06-13 15:07:18
【问题描述】:

我在 Visual Studio Team Services 中的 SonarQube Scanner for MSBuild - End Analysis 构建任务中遇到以下错误。

2017-06-12T14:35:00.1131070Z SonarQube found 7 issues out of which 1 are new
2017-06-12T14:35:00.1131070Z 
2017-06-12T14:35:00.1443593Z 
2017-06-12T14:35:00.1599853Z ##[error]System.Management.Automation.RuntimeException: Internal Error: expected E:\\CI02\16\s to be a parent of E:\CI02\16\s\path\to\my\file.cs ---> System.Management.Automation.RuntimeException: Internal Error: expected E:\\CI02\16\s to be a parent of E:\CI02\16\s\path\to\my\file.cs
2017-06-12T14:35:00.1599853Z    --- End of inner exception stack trace ---
2017-06-12T14:35:00.1599853Z    at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
2017-06-12T14:35:00.1599853Z    at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
2017-06-12T14:35:00.1599853Z    at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
2017-06-12T14:35:00.1599853Z    at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2017-06-12T14:35:00.1599853Z    at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2017-06-12T14:35:00.1599853Z    at Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(String[] args)
2017-06-12T14:35:00.1756102Z ##[error]LegacyVSTSPowerShellHost.exe completed with return code: -1.
2017-06-12T14:35:00.1756102Z ##[section]Finishing: Complete the SonarQube analysis

从日志中可以看出,它失败了,因为E:\\CI02\16\s 不是E:\CI02\16\s\path\to\my\file.cs 的父级(注意E: 后面的反斜杠数量不同)。

通过查看构建任务的source code,我可以看到它期望文件路径以Build.Repository.LocalPath 任务上下文变量的值开头。我不明白为什么斜线的数量会有所不同。

这仅在从拉取请求触发构建时发生。如果我手动排队构建它会成功而没有问题。

我使用的是 SonarQube for Team Services 的 2.1.2 版。

有人知道解决此问题的方法或有任何建议吗?

【问题讨论】:

    标签: sonarqube sonarqube-scan azure-pipelines-build-task


    【解决方案1】:

    问题自行解决。第二天早上我从拉取请求中重新触发了构建,它成功地没有问题。

    【讨论】:

    • 感谢您的跟进。可能是 VSTS 代理的临时配置错误。
    猜你喜欢
    • 2016-11-23
    • 2017-08-17
    • 2016-03-30
    • 2018-06-25
    • 2019-10-24
    • 2023-03-26
    • 1970-01-01
    • 2017-07-08
    • 2017-04-27
    相关资源
    最近更新 更多