which versions are you using (SonarQube 9.4.0-DE, dockerized)
what are you trying to achieve
Analysis of master branch
what have you tried so far to achieve this
Normal processing of code base in Jenkins, Overview page shows a warning. Log file contains stack-trace for failure:
2022.07.12 08:39:43 INFO ce[AYHxkGIhMeSggZqRht3T][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Webhooks | globalWebhooks=0 | projectWebhooks=0 | status=SUCCESS | time=2ms
2022.07.12 08:39:43 INFO ce[AYHxkGIhMeSggZqRht3T][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=SUCCESS | time=0ms
2022.07.12 08:39:44 WARN ce[AYHxkGIhMeSggZqRht3T][c.s.F.C.A.B] Failed to access GitHub, the repository or the Pull Request
2022.07.12 08:39:44 WARN ce[AYHxkGIhMeSggZqRht3T][c.s.F.D.F.J] Branch decoration failed
java.lang.IllegalStateException: Failed to report status to Devops platform: couldn't get the branch details
at com.sonarsource.F.D.F.J.B(Unknown Source)
at com.sonarsource.F.D.F.J.D(Unknown Source)
at java.base/java.util.Optional.orElseThrow(Optional.java:408)
at com.sonarsource.F.D.F.J.C(Unknown Source)
at com.sonarsource.F.D.F.J.A(Unknown Source)
at com.sonarsource.F.D.F.L.A(Unknown Source)
at com.sonarsource.F.D.k.A(Unknown Source)
at org.sonar.ce.async.SynchronousAsyncExecution.addToQueue(SynchronousAsyncExecution.java:27)
at com.sonarsource.F.D.k.A(Unknown Source)
at java.base/java.util.Optional.ifPresent(Optional.java:183)
at com.sonarsource.F.D.k.finished(Unknown Source)
at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.executeTask(PostProjectAnalysisTasksExecutor.java:102)
at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.finished(PostProjectAnalysisTasksExecutor.java:93)
at org.sonar.ce.task.step.ComputationStepExecutor.executeListener(ComputationStepExecutor.java:90)
at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:62)
at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:75)
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:131)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:74)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
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:829)
2022.07.12 08:39:44 INFO ce[AYHxkGIhMeSggZqRht3T][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Report branch Quality Gate status to devops platforms | status=SUCCESS | time=1014ms
2022.07.12 08:39:44 INFO ce[AYHxkGIhMeSggZqRht3T][o.s.c.t.CeWorkerImpl] Executed task | project=com.XXX.vod.catalog:pubmind-core | type=REPORT | branch=master | branchType=BRANCH | id=AYHxkGIhMeSggZqRht3T | submitter=sonar | status=SUCCESS | time=4426ms
Could you go to the projectās Background Tasks page (under Project Settings) and use the cog menu on the relevant task to look at the scanner context? Iām interested in the āProject scanner propertiesā section to know whether branch/PR parameters were passed to the analysis.
Yes, usually dependent on job setup in Jenkinsfile. At one time, we suggested developers specify branch properties, but then were told it was not necessary, so I reversed those instructions. I learned later that strategy was often incorrect. I can try re-running this job with Jenkins Replay option to observe results. However, as I pointed out since this is master, it should NOT be handled as a Pull-Request.
9.4.0 now, planning 9.6.0 upgrade now. My manager has been reluctant to upgrade on x.x.0 releases, expecting point releases to follow as was true a while back.
It isnāt being treated as a PR; itās trying to publish the quality gate status on your master branch. I understand the āPull Request decorationā line is confusing, but the important line is just underneath: āBranch decoration failedā.
It looks like the API call to {GITHUB_API_URL}/repos/{REPO}/branches/master isnāt returning any info.
Can SonarQube correctly contact your GitHub server (you can check this via Administration > General Settings > DevOps Platform Integrations)?
If it can, could it be your branch name is somehow different on Jenkins than on GitHub (like after a renaming from āmasterā to āmainā, or vice-versa)?
Are you using github.com, or GitHub Enterprise? If the latter, which version are you using?
Patch releases are more the exception rather than the rule (except if youāre on an LTS version). At least, we try very hard to keep it like that . Of course, 9.6.1 is proving me wrong here . But there are many versions that never had a patch version (like 9.1.0, 9.3.0, 9.4.0, and 9.5.0).
And did you manage to check whether SonarQube can correctly contact GitHub? You can check this via Administration > General Settings > DevOps Platform Integrations. Click on the GitHub tab, and click on Check configuration.
So apparently thereās an issue with your master branch on GitHub. Iād investigate in that direction. SonarQube is reporting that it cannot publish a Quality Gate status to your master branch, because GitHub returns an error. It doesnāt seem related to SonarQube itself.