SonarQube PR Decorations Check stuck in Queued

I’m trying to implement the newer way to handle Pull Requests with SonarQube 7.7. I think we have everything setup properly but for some reason the Check in Github is stuck on Queued.

These are the related parameters that I have from the sonar context:
Global server settings:

  • sonar.pullrequest.github.endpoint=https://github.optum.com/api/v3
  • sonar.pullrequest.provider=GitHub
  • sonar.alm.github.app.id=50
  • sonar.alm.github.app.name=SonarQubePRChecks
  • sonar.alm.github.app.privateKey.secured=******
    Project scanner properties:
  • sonar.projectName=SonarTools-UI
  • sonar.projectVersion=#2
  • sonar.pullrequest.base=master
  • sonar.pullrequest.branch=PR-9
  • sonar.pullrequest.github.repository=sonartools/Sonartools-React-JS-Frontend
  • sonar.pullrequest.key=9
  • sonar.pullrequest.provider=github

And yes my branch name is actually PR-9

We have the GitHub Application setup thats called SonarQubePRChecks and its showing up correctly as far as I know.

When I create my pull request the build gets kicked off in Jenkins and my other type of checks:
continuous-integration/jenkins/pr-merge
continuous-integration/jenkins/branch
They get kicked off and have “This commit looks good”

But on the Checks tab it shows SonarQubePRChecks Queued xx minutes ago

I’m not sure where to start on troubleshooting for this. I don’t see anything in the Jenkins logs about PR decorations.

I do see:
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=55ms

and

INFO: Pull request 9 for merge into master from PR-9

From this page:
https://docs.sonarqube.org/7.7/analysis/pull-request/

  • (For GitHub Enterprise) Specify your pull request provider, create a GitHub App and configure your SonarQube instance, and set your GitHub parameters.

Specify your pull request provider:
sonar.pullrequest.provider=github
INFO: SCM provider for this project is: git

create a GitHub App: Named SonarQubePRChecks

configure your SonarQube instance:

  • sonar.pullrequest.github.endpoint=https://github.optum.com/api/v3
  • sonar.pullrequest.provider=GitHub
  • sonar.alm.github.app.id=50
  • sonar.alm.github.app.name=SonarQubePRChecks
  • sonar.alm.github.app.privateKey.secured=******

set your GitHub parameters.

  • sonar.pullrequest.base=master
  • sonar.pullrequest.branch=PR-9
  • sonar.pullrequest.key=9
1 Like

We’re seeing this issue also

I ended up needing to remove the space/new lines from the key I put into sonarqube and then I got it to work.

To find the issue I went into sonarqube

  • Browse to Menu Administration --> System --> Logs Level and change to DEBUG
  • Re-run a PR analysis & decoration
  • Revert log level to INFO
  • Look at the Compute Engine log > sonarqube_ce.log

I saw this in the logs:
java.lang.IllegalStateException: Failed to read Github Application private key

3 Likes

This worked for me too. Thanks! Whitespace/Carriage returns in the key.

1 Like

Hi,

I’m so glad you worked through this! Thanks for sharing your solution!

 
Ann

Hi,

We are trying to setup sonarqube PR decorations as well, we followed the documentation in sonarqube website however our SonarQube checks still in queued.

When we follow your steps and check the ce.log, we found a different error which is :

2020.01.03 16:31:29 ERROR ce[abc–mz][c.s.C.A.C.A.A.C] Failed to request /repos/org/repo/installation

java.io.IOException: Unexpected response code for CONNECT: 403

Our sonarqube version : * Enterprise Edition

  • Version 7.9.1 (build 27448)

Any steps we miss ? Thanks for your assistance !