SonarQube MSBuild 结束分析失败 - 预期 X 是 Y 的父级
SonarQube MSBuild End Analysis Failure - Expected X to be a parent of Y
我在 SonarQube Scanner for MSBuild - End Analysis Visual Studio 团队服务中的构建任务中遇到以下错误.
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\s to be a parent of E:\CI02\s\path\to\my\file.cs ---> System.Management.Automation.RuntimeException: Internal Error: expected E:\CI02\s to be a parent of E:\CI02\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\s
不是 E:\CI02\s\path\to\my\file.cs
的父级(请注意 E:
后的反斜杠数量不同)。
通过查看构建任务的 source code,我可以看到它期望文件路径以 Build.Repository.LocalPath
任务上下文变量的值开头。我不明白为什么斜杠的数量会有所不同。
这仅在从拉取请求触发构建时发生。如果我手动对构建进行排队,它会毫无问题地成功。
我正在使用 SonarQube for Team Services.
的 2.1.2 版
有没有人知道解决这个问题的方法或有什么建议?
问题已自行解决。第二天早上我从拉取请求中重新触发了构建,它成功了。
我在 SonarQube Scanner for MSBuild - End Analysis Visual Studio 团队服务中的构建任务中遇到以下错误.
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\s to be a parent of E:\CI02\s\path\to\my\file.cs ---> System.Management.Automation.RuntimeException: Internal Error: expected E:\CI02\s to be a parent of E:\CI02\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\s
不是 E:\CI02\s\path\to\my\file.cs
的父级(请注意 E:
后的反斜杠数量不同)。
通过查看构建任务的 source code,我可以看到它期望文件路径以 Build.Repository.LocalPath
任务上下文变量的值开头。我不明白为什么斜杠的数量会有所不同。
这仅在从拉取请求触发构建时发生。如果我手动对构建进行排队,它会毫无问题地成功。
我正在使用 SonarQube for Team Services.
的 2.1.2 版有没有人知道解决这个问题的方法或有什么建议?
问题已自行解决。第二天早上我从拉取请求中重新触发了构建,它成功了。