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

Postanalysis hook in CE fails with IllegalStateException on some failed tasks

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: 6.1
    • Component/s: None
    • Labels:

      Description

      Some report processing tasks have been reported as failed with the stacktrace below when a plugin with a PostProjectAnalysisTask is installed:

      com.google.common.base.Preconditions.checkState(Preconditions.java:173)
        at org.sonar.server.computation.task.projectanalysis.analysis.AnalysisMetadataHolderImpl.getAnalysisDate(AnalysisMetadataHolderImpl.java:69)
        at org.sonar.server.computation.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.getAnalysisDate(PostProjectAnalysisTasksExecutor.java:113)
        at org.sonar.server.computation.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.createProjectAnalysis(PostProjectAnalysisTasksExecutor.java:100)
        at org.sonar.server.computation.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.finished(PostProjectAnalysisTasksExecutor.java:90)
        at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:56)
        at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:75)
        at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:84)
        at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:57)
        at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35)
        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:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
      

      This error seem to occur because the report processing task failed before the analysis date was set in the AnalysisMetadataHolder and the code calling the PostProjectAnalysisTask object calls method AnalysisMetadataHolder#getAnalysisDate even though it has not been set.

      In addition, the cause of the report processing task has been lost.

        Attachments

          Activity

            People

            Assignee:
            sebastien.lesaint Sebastien Lesaint
            Reporter:
            sebastien.lesaint Sebastien Lesaint
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: