SonarQube version: 8.7.1.42226
OpenJDK Runtime Environment 11.0.10+9
Alpine Linux v3.12 (3.12.4)
SonarScanner version: 4.5.0.2216
Java 11.0.7 Oracle Corporation (64-bit)
Linux 4.14.200-155.322.amzn2.x86_64 amd64
SonarQube Scanner for Jenkins version 2.13
We have jenkins integration setup through the SonarQube Scanner for Jenkins plugin. We have both sides configured correctly and it works… for a while. After an unpredictable amount of time and an unpredictable number of scans/webhook calls it will stop working. The webhooks, when they stop working, say: Response: Server Unreachable Duration: 20s. This can be temporarily fixed by doing nothing more than restart SonarQube. The webhooks will then work for an indeterminate period until the problem presents itself again. I believe this to be an issue in SonarQube itself because while the behavior is happening I can connect to the SonarQube system and post the json body from the failed webhook message via wget to the same address that the webhook is configured to use and it works every time I have tried it even while the webhook calls from within SonarQube continue to fail.
Jenkinsfile start the scan
def scannerHome = tool 'SonarScanner'
withSonarQubeEnv('SonarQube') {
sh "${scannerHome}/bin/sonar-scanner"
}
Jenkinsfile wait for the scan to be complete (or timeout once all the webhooks start failing)
timeout(time: 1, unit: 'HOURS') {
def qg = waitForQualityGate()
if (qg.status != 'OK') {
unstable("SonarQube quality gate failure: ${qg.status}")
}
}
Output in jenkins build log when issue is occurring until the timeout occurs
Checking status of SonarQube task 'XXXX' on server 'SonarQube'
SonarQube task 'XXXX' status is 'IN_PROGRESS'
As stated the two “workarounds” that I have found are to restart SonarQube or to complete the post myself. Neither of these are really valid.