Pull request decoration is not possible due to unknown or missing commit

  • Using SonarQube 8.1 DE (trial), Bitbucket v6.5.3, sonarqube-gradle-plugin v2.8
  • I am trying to decorate the pull request in Bitbucket with SonarQube analysis results.
    The PR analysis works fine, in SonarQube are the results available, but I can’t see anything in the PR in the Bitbucket. According to the SonarQube warning and logfiles, the decoration failed due to unknown or missing commit:

2020.02.10 13:26:48 DEBUG ce[AXAvEPjklwFK4KRqyglx][c.s.C.D.A.D] Pull request decoration is not possible due to unknown or missing commit for pull request ‘12’. Please check the scanner logs for any SCM related issue.
2020.02.10 13:26:48 INFO ce[AXAvEPjklwFK4KRqyglx][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=SUCCESS | time=555ms

I could not find anything more in the logfiles.
Thanks for your help.

Welcome to the community!

Can you please explain how exactly you run the PR analysis? Are you using a CI tool, or are you running a command? (What is the full command line?)

Can you please include the logs of the scanner?

PS: If you prefer to keep sensitive details private, let me know and I can start a private thread. (Or you can mask the sensitive values when you post here.)


I run the analysis on the command line, using gradle plugin:

gradlew sonarqube --stacktrace --debug --info -Dsonar.projectKey=??? -Dsonar.host.url=http://???:9000 -Dsonar.verbose=true -Dsonar.login=??? -Dsonar.pullrequest.branch=feature/f13 -Dsonar.pullrequest.key=12

where the task sonarqube is defined as:

sonarqube {
properties {
property ‘sonar.projectName’, ‘???’
property ‘sonar.projectBaseDir’, ‘???’
property ‘sonar.sources’, ‘???.cxx’
property ‘sonar.cfamily.build-wrapper-output’, ‘???’
property ‘sonar.sourceEncoding’, ‘ISO-8859-15’
property ‘sonar.scm.disabled’, ‘true’
property ‘sonar.pullrequest.base’, ‘develop’

being gathering the information I’ve just noticed the property sonar.scm.disabled is set to true. By setting it to false, the decoration works fine. So the problem has been solved. Thx.