Portfolio calculation consistently failing

Summary:

  • versions used: SonarQube 7.6 enterprise, Scanner 3.3, Oracle DB 12c
  • error observed: IllegalStateException: value can not be converted to level because current value type is a NO_VALUE
  • steps to reproduce: I have migrated from fully working 7.4 to 7.6 with failing portfolios
  • potential workaround: have not found any and hoping to get one here

Seems like something went wrong during migration from 7.4 to 7.6. I am getting following exception for most portfolios

org.sonar.ce.task.projectanalysis.component.VisitException: Visit failed for Component {key=PortProj,type=PROJECT_VIEW}  located Port(type=VIEW)
    at org.sonar.ce.task.projectanalysis.component.VisitException.rethrowOrWrap(VisitException.java:44)
    at org.sonar.ce.task.projectanalysis.component.PathAwareCrawler.visit(PathAwareCrawler.java:52)
    at org.sonar.ce.task.projectanalysis.component.PathAwareCrawler.visitChildren(PathAwareCrawler.java:87)
    at org.sonar.ce.task.projectanalysis.component.PathAwareCrawler.visitImpl(PathAwareCrawler.java:70)
    at org.sonar.ce.task.projectanalysis.component.PathAwareCrawler.visit(PathAwareCrawler.java:50)
    at com.A.B.C.D.B.A.execute(Unknown Source)
    at org.sonar.ce.task.step.ComputationStepExecutor.executeStep(ComputationStepExecutor.java:81)
    at org.sonar.ce.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:72)
    at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:59)
    at com.A.B.C.D.E.A.A.A(Unknown Source)
    at com.A.B.C.D.E.A.D.A(Unknown Source)
    at com.A.B.C.G.A.B(Unknown Source)
    at com.A.B.C.G.A.process(Unknown Source)
    at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:207)
    at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:189)
    at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:156)
    at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:131)
    at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:83)
    at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:51)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: value can not be converted to level because current value type is a NO_VALUE
    at org.sonar.ce.task.projectanalysis.measure.Measure.checkValueType(Measure.java:307)
    at org.sonar.ce.task.projectanalysis.measure.Measure.getLevelValue(Measure.java:290)
    at com.A.B.C.D.B.A$_A.initialize(Unknown Source)
    at org.sonar.ce.task.projectanalysis.formula.FormulaExecutorComponentVisitor.processLeaf(FormulaExecutorComponentVisitor.java:148)
    at org.sonar.ce.task.projectanalysis.formula.FormulaExecutorComponentVisitor.process(FormulaExecutorComponentVisitor.java:125)
    at org.sonar.ce.task.projectanalysis.formula.FormulaExecutorComponentVisitor.visitProjectView(FormulaExecutorComponentVisitor.java:120)
    at org.sonar.ce.task.projectanalysis.component.PathAwareCrawler.visitNode(PathAwareCrawler.java:111)
    at org.sonar.ce.task.projectanalysis.component.PathAwareCrawler.visitImpl(PathAwareCrawler.java:73)
    at org.sonar.ce.task.projectanalysis.component.PathAwareCrawler.visit(PathAwareCrawler.java:50)
    ... 25 more

I have also raised this on stackoverflow here: https://stackoverflow.com/questions/54901403/sonarqube-portfolio-calculation-failing

Hello Anton,

This issue is related to a change in the QG statuses that occurred in the 7.5 version of SQ.
To get rid of this issue you need first to re-analyse your projects to migrate their QG status.
Then you will be able to recompute your portfolios.

Alex.

1 Like

thank you for the answer. I was under impression that scans did not help because I kept seeing exception for re-scanned project. But now I removed couple projects from the portfolio and it resolved the issue

Thanks for help!
Tono

And FYI, here is the JIRA ticket that will fix this issue : https://jira.sonarsource.com/browse/SONAR-11747

1 Like