问题描述
我最近将我们的 SonarQube 服务器从 5.1.2 升级到了 5.2.我们通过 Jenkins 使用 SonarQube Runner (2.4) 运行分析,分析成功.问题是分析不会被服务器处理.在失败的后台任务显示的日志末尾可以看到以下错误:
I have recently upgraded our SonarQube server from 5.1.2 to 5.2. We run the analysis using the SonarQube Runner (2.4) via Jenkins and the analysis succeeds. The problem is that the analysis then doesn't get processed by the server. The following error can be seen at the end of the log which is shown for the failed background task:
主要错误是这样的:
java.lang.UnsupportedOperationException: QualityGate status can not be changed if already set on source Measure
我不知道这可能指的是什么……这里有更多日志:
I have no idea what this could be referring to... here is more of the logs:
2015.11.05 13:53:18 INFO [o.s.s.c.s.ComputationStepExecutor] Compute size measures | time=1114ms
2015.11.05 13:53:21 INFO [o.s.s.c.s.ComputationStepExecutor] Compute new coverage | time=2683ms
2015.11.05 13:53:21 INFO [o.s.s.c.s.ComputationStepExecutor] Compute coverage measures | time=586ms
2015.11.05 13:53:21 INFO [o.s.s.c.s.ComputationStepExecutor] Compute comment measures | time=118ms
2015.11.05 13:53:22 INFO [o.s.s.c.s.ComputationStepExecutor] Copy custom measures | time=947ms
2015.11.05 13:53:22 INFO [o.s.s.c.s.ComputationStepExecutor] Compute duplication measures | time=58ms
2015.11.05 13:53:22 INFO [o.s.s.c.s.ComputationStepExecutor] Compute language distribution | time=80ms
2015.11.05 13:53:22 INFO [o.s.s.c.s.ComputationStepExecutor] Compute test measures | time=23ms
2015.11.05 13:53:23 INFO [o.s.s.c.s.ComputationStepExecutor] Compute complexity measures | time=555ms
2015.11.05 13:53:23 INFO [o.s.s.c.s.ComputationStepExecutor] Load measure computers | time=12ms
2015.11.05 13:53:30 INFO [o.s.s.c.s.ExecuteVisitorsStep] Execution time for each component visitor:
2015.11.05 13:53:30 INFO [o.s.s.c.s.ExecuteVisitorsStep] - LoadComponentUuidsHavingOpenIssuesVisitor | time=104ms
2015.11.05 13:53:30 INFO [o.s.s.c.s.ExecuteVisitorsStep] - IntegrateIssuesVisitor | time=6566ms
2015.11.05 13:53:30 INFO [o.s.s.c.s.ExecuteVisitorsStep] - CloseIssuesOnRemovedComponentsVisitor | time=0ms
2015.11.05 13:53:30 INFO [o.s.s.c.s.ExecuteVisitorsStep] - SqaleMeasuresVisitor | time=85ms
2015.11.05 13:53:30 INFO [o.s.s.c.s.ExecuteVisitorsStep] - SqaleNewMeasuresVisitor | time=42ms
2015.11.05 13:53:30 INFO [o.s.s.c.s.ExecuteVisitorsStep] - LastCommitVisitor | time=5ms
2015.11.05 13:53:30 INFO [o.s.s.c.s.ExecuteVisitorsStep] - MeasureComputersVisitor | time=30ms
2015.11.05 13:53:30 INFO [o.s.s.c.s.ComputationStepExecutor] Execute component visitors | time=6924ms
2015.11.05 13:53:33 INFO [o.s.s.c.s.ComputationStepExecutor] Compute measure variations | time=2634ms
2015.11.05 13:53:33 ERROR [o.s.s.c.t.CeWorkerRunnableImpl] Failed to execute task AVDY_uRG1PIBOHYznvP3
java.lang.UnsupportedOperationException: QualityGate status can not be changed if already set on source Measure
at org.sonar.server.computation.measure.Measure$UpdateMeasureBuilder.setQualityGateStatus(Measure.java:244) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.step.QualityGateMeasuresStep.updateMeasures(QualityGateMeasuresStep.java:113) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.step.QualityGateMeasuresStep.executeForProject(QualityGateMeasuresStep.java:95) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.step.QualityGateMeasuresStep.access$000(QualityGateMeasuresStep.java:61) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.step.QualityGateMeasuresStep$1.visitProject(QualityGateMeasuresStep.java:85) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visitNode(DepthTraversalTypeAwareCrawler.java:63) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:44) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.step.QualityGateMeasuresStep.execute(QualityGateMeasuresStep.java:81) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:39) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:53) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.taskprocessor.CeWorkerRunnableImpl.executeTask(CeWorkerRunnableImpl.java:78) [sonar-server-5.2.jar:na]
at org.sonar.server.computation.taskprocessor.CeWorkerRunnableImpl.run(CeWorkerRunnableImpl.java:55) [sonar-server-5.2.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_85]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) [na:1.7.0_85]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_85]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.7.0_85]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_85]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_85]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_85]
有没有人以前见过这个或知道可能出了什么问题?
Has anyone seen this before or have any idea what might be wrong?
谢谢.
推荐答案
我升级到5.2后也遇到了同样的问题.正如上面评论中提到的,我确实在我的质量门中为多个时期(自上一版本以来,自先前分析以来,过去 30 天)定义了条件(新代码的覆盖范围).它以前像一个魅力,现在它坏了.
I have the same problem since upgrade to 5.2. As mentioned in the comment above, I indeed had conditions (coverage on new code) defined for multiple periods (since previous version, since previous analysis, for last 30 days) in my quality gates. It worked like a charm before, now it's broken.
通过只为指标保留一个条件(自上一个版本以来新代码的覆盖率应为 80%"),我设法绕过了该错误.
By leaving only one condition for the metric ("coverage on new code since the last version should be 80%") I've managed to bypass the error.
但是,我必须说,现在整个事情都坏了,这很烦人.同一指标的多个周期非常有用.例如,since previous version"显示自发布以来我们表现如何",since previous analysis"显示上次提交有多好".
However, I must say it is very annoying that the whole thing is broken now. Multiple periods for the same metric were very useful. For example, "since previous version" shows "how good are we doing since release", and "since previous analysis" shows "how good was the last commit".
这篇关于SonarQube 分析成功但未被服务器处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!