Jenkins: Blocking Pull Request merges

We already have Plugins installed for bitbucket server and sonarqube in jenkins
and We ran the sonar using this command in the Jenkinsfile

agent {
docker {
image ‘my-artifactory-url.com/sonarsource/sonar-scanner-cli:4
reuseNode true
}
}
steps {
sh “/usr/bin/entrypoint.sh sonar-scanner -Dsonar.login=‘<tokenid>’ -Dsonar.language=js -Dsonar.projectKey=<project-key> -Dsonar.sources=test -Dsonar.profile=node -Dsonar.host.url=https://<url> -Dsonar.branch.name=<git-branch-name>”
}

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube 8.8

  • what are you trying to achieve
    Blocking Pull Request merges

  • what have you tried so far to achieve this

I added the key com.sonarsource.sonarqube in the bitbucket repo > pull requests > code insights but I am getting the error

There is 1 issue preventing you from merging this pull request.

  • Report with key ‘com.sonarsource.sonarqube’ has not yet been created

Link: https://docs.sonarqube.org/8.5/analysis/pr-decoration/

Hey there.

Are your Pull Requests being properly analysed in SonarQube? any warnings?

I can see the Left Side drop down with PRs of their status, passed and failed., but I can’t find the See this PR link anywhere.

That’s a good hint something is off. If you check your Project Settings > General Settings > Pull Request Decoration section of your project, is it well configured?

Yes, it has bitbucket server url, project key and slug mentioned. When we restart the sonarqube, this problem goes away for a while but comes back suddenly after a while.

I would suggest checking your ce.log file when the issue starts again to find the precise issue when it begins to fail. Ramping up your log level (Global Administration > System > Log Level) can be helpful as well.

Can you tell me more about your SonarQube instance? Is it running on a VM, in a Docker container, …?