SonarQube task 'AXBndaVUxZC94hEtWT6Q' status is 'PENDING' in Jenkins

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) - sonar-maven-plugin:3.6.0.1398; SonarQube version: 6.7.0
  • what are you trying to achieve - For some reason, the quality gate stuck on PENDING status in Jenkins. I’m trying to understand why this is happening, and what could be done to avoid moving the quality gate check to success.
  • what have you tried so far to achieve this
    I tried with following items:
    1.Webhook was configured properly in sonarqube
    2.waitForQualityGate configured in Jenkins pipeline as mentioned below
stage("Quality Gate") {
            steps {
                waitForQualityGate abortPipeline: true
            }
        }
  1. Able to get success response when i do curl from node to sonarqube

Could someone in this forum help me to resolve this issue.

Hi,

Welcome to the community!

I would start by checking this from both ends:

  • in SonarQube, does the webhook show up as having been delivered?
  • in Jenkins, does the webhook call show up in the Jenkins server log

 
HTH,
Ann

Hello, we are experiencing the same issue started about 1 week ago. Probably about an update on sonarqube or jenkins, I’m not sure.
Jenkins log: Checking status of SonarQube task ‘AXB7kyxpWH4JWL_qY_lr’ on server ‘sonarqube’ SonarQube task ‘AXB7kyxpWH4JWL_qY_lr’ status is ‘PENDING’

Cancelling nested steps due to timeout

Scan result is like this:

{
“task”: {
“id”: “AXB7kyxpWH4JWL_qY_lr”,
“type”: “REPORT”,
“componentId”: “AXB3HLXQocTO7QXS11Fk”,
“componentKey”: “xxxxxxxxxx”,
“componentName”: “acceptancetest”,
“componentQualifier”: “TRK”,
“analysisId”: “AXB7kzQBvnwZ3-i5ARP4”,
“status”: “SUCCESS”,
“submittedAt”: “2020-02-25T09:00:07+0000”,
“submitterLogin”: “admin”,
“startedAt”: “2020-02-25T09:00:09+0000”,
“executedAt”: “2020-02-25T09:00:15+0000”,
“executionTimeMs”: 6397,
“logs”: false,
“hasScannerContext”: true,
“organization”: “default-organization”,
“warningCount”: 0,
“warnings”:
}
}

out pipeline code for sonarqube is like this:

withSonarQubeEnv(‘sonarqube’) {
sh ‘mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar’
}
timeout(time: 2, unit: ‘MINUTES’) {
waitForQualityGate abortPipeline: true
}

@taylan are you experiencing this on SonarCloud or an in-house version of SonarQube?

 
Ann

Hi @ganncamp , it’s in-house version

Hi @taylan,

I’ll start by giving you the same advice I gave the OP:

Also, you say your pipelines are timing out, and I see that you’ve set your timeout at 2min. That seems a little optimistic to me. You might want to bump it up to 5min.

 
HTH,
Ann

Hi Ann,

Thanks for coming back. I could see following error in jenkins log, can you have a look and share your thoughts on this please

“While serving (jenkins job url) : org.acegisecurity.AccessDeniedException: Please log in to access Boarding”

Hi,

Is your Jenkins job not visible to anonymous users? Maybe you need to add credentials to your webhook?

 
Ann

Hi,

Job is visible to anonymous users. Still do i need to add credentials in webhook?

Hi,

No, probably not. Do you know / can you tell if the analysis reports in question were processed very quickly? If so, you may be falling victim to a race condition that we’ve discovered internally very recently. (Still under investigation, so no tickets I can point you to yet.)

 
Ann

Thank you very much. The problem was on webhook to jenkins on my sonarqube instance. Solved now

Hi Taylan!

Would you mind sharing what the problem was? (and if it is configurable in sonarqube - how you overcame it)? That might help our future selves, when we - in the future - search for solutions.

Getting the description of the solution is wayy better than reading that something got solved

TIA Daniel

3 Likes

The webhook was deleted somehow. I couldn’t see that in the first place, my fault.

1 Like

Hi, @ganncamp Do you find any issues to jenkins plugin that sends the QG status check? We are facing this issues of the Pending status.
Under CE task we can see task shows that it only took a little over five seconds to complete, well within the 10 minute timeout that we increase from 3 minutes.

stage("SonarQube Quality Gate check") {
        //Force to fail step after specific time
        timeout(time: 10, unit: 'MINUTES')

CE status

    "status": "SUCCESS",
    "submittedAt": "2022-08-09T14:20:07+0000",
    "submitterLogin": "api-user",
    "startedAt": "2022-08-09T14:20:12+0000",
    "executedAt": "2022-08-09T14:20:18+0000",
    "executionTimeMs": 5384

It is necessary to define a webhook in the sonarqube instance (if required what address should be, is it pointing to Jenkins server? or to sonrqube itself)

I also see suggestions from other folks faced the same issues to just add few seconds sleep between SQ analysis and QG check. Jenkins : waitForQualityGate function returns PENDING status and stays like that, even if the status is SUCCESS after 1 second (1) as they say it is an workaround and not a solution

Hi @rajatrj16,

Please create a new thread and include the details of your pipeline.

 
Ann

Okay, I have created new topic here Sonarqube Quality Gate is timing out in Jenkins - SonarQube task 'AKC-qLnO' status is 'PENDING'