Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-15091

Compute engine fails with NPE if an external issue has an empty message

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9.0
    • Component/s: Compute Engine
    • Labels:
    • Edition:
      Community
    • Production Notes:
      None

      Description

      If an issue is imported from an external rule engine with an empty message (""), it will end up being saved in the DB with a null message.
      The next time the project is analyzed with the same issue, the issue tracking fails with a NullPointerException because of the issue without message in the DB.

      This bug affects all versions at least since 7.9.

      > org.sonar.ce.task.projectanalysis.component.VisitException: Visit of Component {key=key0:file.xoo,type=FILE} failed
      > 	at org.sonar.ce.task.projectanalysis.component.VisitException.rethrowOrWrap(VisitException.java:44)
      > 	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:74)
      > 	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:110)
      > 	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:97)
      > 	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)
      > 	at org.sonar.ce.task.projectanalysis.step.ExecuteVisitorsStep.execute(ExecuteVisitorsStep.java:51)
      > 	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 org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
      > 	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:212)
      > 	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:194)
      > 	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:160)
      > 	at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:135)
      > 	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:87)
      > 	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
      > 	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
      > 	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
      > 	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
      > 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      > 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      > 	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
      > 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      > 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      > 	at java.base/java.lang.Thread.run(Thread.java:835)
      > Caused by: java.lang.IllegalStateException: Fail to process issues of component 'key0:file.xoo'
      > 	at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:79)
      > 	at org.sonar.ce.task.projectanalysis.component.TypeAwareVisitorWrapper.visitAny(TypeAwareVisitorWrapper.java:77)
      > 	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitNode(VisitorsCrawler.java:117)
      > 	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:100)
      > 	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)
      > 	... 23 common frames omitted
      > Caused by: java.lang.NullPointerException: null
      > 	at org.sonar.core.issue.tracking.AbstractTracker$LineAndLineHashAndMessage.equals(AbstractTracker.java:111)
      > 	at java.base/java.util.HashMap.getNode(HashMap.java:567)
      > 	at java.base/java.util.HashMap.get(HashMap.java:552)
      > 	at com.google.common.collect.AbstractMapBasedMultimap.get(AbstractMapBasedMultimap.java:287)
      > 	at com.google.common.collect.AbstractListMultimap.get(AbstractListMultimap.java:76)
      > 	at com.google.common.collect.ArrayListMultimap.get(ArrayListMultimap.java:61)
      > 	at com.google.common.collect.AbstractListMultimap.get(AbstractListMultimap.java:35)
      > 	at org.sonar.core.issue.tracking.AbstractTracker.lambda$match$2(AbstractTracker.java:46)
      > 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
      > 	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
      > 	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)
      > 	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
      > 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
      > 	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
      > 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
      > 	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      > 	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
      > 	at org.sonar.core.issue.tracking.AbstractTracker.match(AbstractTracker.java:44)
      > 	at org.sonar.core.issue.tracking.Tracker.trackNonClosed(Tracker.java:37)
      > 	at org.sonar.ce.task.projectanalysis.issue.TrackerExecution.track(TrackerExecution.java:53)
      > 	at org.sonar.ce.task.projectanalysis.issue.IssueTrackingDelegator.track(IssueTrackingDelegator.java:52)
      > 	at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:72)
      > 	... 27 common frames omitted
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              duarte.meneses Duarte Meneses
              Reporter:
              duarte.meneses Duarte Meneses
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: