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

"IllegalStateException: Branch has not been set" when project key in report doesn't match project key

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.1
    • Fix Version/s: 7.1
    • Component/s: Compute Engine
    • Labels:

      Description

      The following error occurred on SonarCloud

      2018.02.23 10:39:27 ERROR ce[AWHCBgac1uc8gbLrNc81][o.s.s.c.t.s.ComputationStepExecutor] Execution of listener failed
      java.lang.IllegalStateException: Branch has not been set
              at com.google.common.base.Preconditions.checkState(Preconditions.java:173)
              at org.sonar.server.computation.task.projectanalysis.analysis.AnalysisMetadataHolderImpl.getBranch(AnalysisMetadataHolderImpl.java:147)
              at org.sonar.server.computation.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.createBranch(PostProjectAnalysisTasksExecutor.java:181)
              at org.sonar.server.computation.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.createProjectAnalysis(PostProjectAnalysisTasksExecutor.java:127)
              at org.sonar.server.computation.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.finished(PostProjectAnalysisTasksExecutor.java:104)
              at org.sonar.server.computation.task.step.ComputationStepExecutor.executeListener(ComputationStepExecutor.java:71)
              at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:56)
              at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:73)
              at org.sonar.ce.taskprocessor.CeWorkerImpl.executeTask(CeWorkerImpl.java:134)
              at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:97)
              at org.sonar.ce.taskprocessor.CeWorkerImpl.withCustomizedThreadName(CeWorkerImpl.java:81)
              at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:73)
              at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:43)
              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)
      

      It is caused by the following functional check done before the branch is set:

      ProjectKey in report (pckt1234) is not consistent with projectKey under which the report as been submitted (pocket-api)
      

      This issue is odd as it implies the analysis report was pushed to the server with a projectKey which differs from the one in the report.

      Scanners are responsible to submit the report to SonarQube and, as far as my understanding is correct, they take the projectKey from the same source to put in the report and to pass as a parameter to the api/ce/submit WS.

        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: