文件移动后SonarQube分析任务错误

本文关键字:任务 错误 SonarQube 移动 文件 | 更新日期: 2023-09-27 18:12:58

我们一直在c#项目中使用SonarQube分析,作为TFS 2015/15 RC2 vNext构建的一部分,它一直工作良好。

几天前,我重构了代码的几个方面,这包括将文件移动到同一个项目中的新文件夹中,而不是更改类名等。Visual Studio没有正确处理这个问题,我不得不逐个删除并重新添加一些文件到项目中。

我们的分析现在失败了,当查看分析任务的日志时,我可以看到以下错误:

ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVe_-iOpE8SSKScA9O_3 java.lang.IllegalStateException:
  Original file OriginalFile{id=1363, uuid='ca50dc09-5d0b-4083-9e52-eb0f66361422', key='MIS:MIS:4E9625D2-557E-450C-90CC-A6B6FB57B6C9:Models/XXX/Grids/ProjectTeams/SmpProjectTeamFilterModel.cs'}
  already registered for file
  ComponentImpl{key='StanMIS:StanMIS:4E9625D2-557E-450C-90CC-A6B6FB57B6C9:Models/Smp/Grids/ProjectTeams/SmpProjectTeamFilterModel.cs', type=FILE, uuid='AVe_-nQKU1hbfyCkniEZ', name='', description='null', fileAttributes=FileAttributes{languageKey='cs', unitTest=false},
  reportAttributes=ReportAttributes{ref=1506, version='null',
  path='Models/Smp/Grids/ProjectTeams/SmpProjectTeamFilterModel.cs'}}.
  Unable to register OriginalFile{id=1353, uuid='1488ce7d-094c-4859-9e23-adae0f1ac2a3', key='StanMIS:StanMIS:4E9625D2-557E-450C-90CC-A6B6FB57B6C9:Models/XXX/Grids/DStanContacts/SmpDStanContactFilterModel.cs'}.
    at com.google.common.base.Preconditions.checkState(Preconditions.java:197) ~[guava-18.0.jar:na]
    at org.sonar.server.computation.filemove.MutableMovedFilesRepositoryImpl.setOriginalFile(MutableMovedFilesRepositoryImpl.java:41) ~[sonar-server-6.0.jar:na]
    at org.sonar.server.computation.filemove.FileMoveDetectionStep.registerMatches(FileMoveDetectionStep.java:144) ~[sonar-server-6.0.jar:na]
    at org.sonar.server.computation.filemove.FileMoveDetectionStep.execute(FileMoveDetectionStep.java:139) ~[sonar-server-6.0.jar:na]
    at org.sonar.server.computation.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:64) ~[sonar-server-6.0.jar:na]
    at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52) ~[sonar-server-6.0.jar:na]
    at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:75) ~[sonar-server-6.0.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:81) ~[sonar-server-6.0.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:56) ~[sonar-server-6.0.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35) [sonar-server-6.0.jar:na]
    at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_45]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.8.0_45]
    at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_45]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [na:1.8.0_45]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [na:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_45]
    at java.lang.Thread.run(Unknown Source) [na:1.8.0_45]
ERROR [o.s.s.c.t.CeWorkerCallableImpl] Executed task | project=MIS | type=REPORT | id=AVe_-iOpE8SSKScA9O_3 | submitter=XXX | time=24633ms

文件移动后SonarQube分析任务错误

你面对https://jira.sonarsource.com/browse/SONAR-8013。