Sonarqube Plugin for Jenkins Doesn't retry after failure, it gets stuck in 'PENDING'

jenkins
scanner

(Evan Root) #1

This is a race condition report.
The google groups linked below outline that many other have found this issue.
However after my team troubleshot the issue we’re pretty sure that it isn’t clear that the plugin just needs a bit of login to fail/retry a few times over 5 seconds or so. We proved that the https is correct so that was a red herring related to misconfiguration which may have prevented this from being a bug in the past.

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube Jenkins Plugin: 2.7.1
    SonarQube: Version 7.0 (build 36138)
    Jenkins: Jenkins ver. 2.107.2

  • error observed
    None; the plugin hangs if the REST URL isn’t ready on the first try.
    As obvserved here: https://groups.google.com/forum/#!topic/sonarqube/nJEyTuadwFI
    I also found this from David Karr: Scan using branch plugin and webhook fails to get quality gate and doesn’t report back to stash

  • steps to reproduce
    It’s a performance race condition. Cannot reliably be replicated except in situ. But the simple solution is just to ensure that a retry is attempted after a timeout.

  • potential workaround
    Sleep 5 in the Jenkins groovy script is essentially always successful. It seems that just waiting five seconds allows the REST URL to finish getting available.


(David Karr) #2

Reading through this information, I tried adding a sleep between the two tasks. The good news is that that got rid of the infinite wait for the quality gate. Unfortunately, now it just returns “ERROR”. It doesn’t give me any other information. My BitBucket pull request wasn’t updated with any information. It had originally reported “Code Smells 19 > 0”, which is what I got before I moved from BuildBreaker to Webhook, so I think it’s just not getting any information back.


(G Ann Campbell) #3

Hi,

In most cases where this type of behavior has been reported, the configuration of the webhook has been at fault. Can you

  • check your Jenkins log to see if the webhook call is being received
  • check your webhooks console to see the response code

?

Ann


(Stanisław Kodzis) #4

It’s in Multibranch pipeline. There is no webhook in Jenkins job only in BB. Please fix the bug.