Troubleshooting SonarQube unsuccessful webhook POSTs to Jenkins

Must-share information (formatted with Markdown):

  • Which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension):
    SonarQube: 8.2
    Plugin: 2.8.1

  • What are you trying to achieve
    I’m trying to implement the waitForQualityGate() stage in my Jenkins pipelines, and this stage is timing out as the quality gate status (per Jenkins) is stuck in the PENDING status. This is incorrect however, and is seemingly a result of the webhook failing to receive a POST from our SonarQube instance.
    SonarQube response:
    Response: Server Unreachable Duration: 116ms

  • What have you tried so far to achieve this

  1. Verified that the firewall is not a blocker. I can successfully telnet from our SonarQube server to our Jenkins master over port 443.
  2. Attempted to use HTTP basic authentication in the webhook URL configuration.

I’d like to get a better understanding of why the server is being shown as unreachable. I checked out the sonar logs and I don’t see any sort of 400/500 errors being returned back to Sonar, but then again I don’t see anything at all related to the failed webhook POST in the logs.

How could I actually view the HTTP response I’m getting? The current level of logging and errors shown in the UI are too generic and unhelpful.

I was able to capture some additional debugging output, and this looks like it’s the culprit

Jul 28 10:42:22 do83 97f7e942110a: 2020.07.28 16:42:22 DEBUG ce[AXOWTWSbWBtZj62MYGg9][o.s.s.w.WebHooksImpl] Failed to send webhook 'Jenkins Quality Gate Stage' | url=https://our.jenkins.instance/java/sonarqube-webhook/ | message=unable to find valid certification path to requested target

The root and issuing certs for our org are in the sonar truststore, similar to how they exist for the Jenkins isntance, so I’m still at something of a loss.

I’ve sorted this out. While the web engine had the correct truststore location passed in, the compute engine did not. Once I defined the truststore location for the ce it worked.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.