We are currently facing an issue regarding the SonarQube Scanner for Jenkins.
We are using the SonarQube Scanner plugin and the pipeline step waitForQualityGate to wait for the quality gate.
These are the versions that we are using:
SonarQube - Enterprise EditionVersion 7.9.1
Jenkins - version 2.176.2
SonarQube Scanner - version 2.9
The error that we are facing is this:
Checking status of SonarQube task 'AW-LZTb0qGmbA3dcwcDk' on server 'SonarQubeServer'
Fail to request https://ourhost:9010/SonarQube/api/ce/task?id=AW-LZTb0qGmbA3dcwcDk
The error appeared when we changed our sonar.core.serverBaseURL with an HTTPS URL . We did this because our decorations for pull requests in GitHub didnât work with the HTTP URL. All the images were disabled so we configured a reverse proxy.
In Jenkins we configured our âSonarQubeServerâ to use this URL http://ourhost:9000/SonarQube and during the SonarQube scanning step we are using this argument: sonar.host.url=http://ourhost:9000/SonarQube.
The analyze is performed, but on the SonarScanner logs this appear:
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at https://ourhost:9010/SonarQube/api/ce/task?id=AW-LZTb0qGmbA3dcwcDk
We searched and it seams that the waitForQualityGate step is reading the URL from the logs and we didnât find a way to configure the step to use the same URL that is used for the scanning step. Our Jenkinfile is something like this:
ERROR: SonarQube server [https://ourhost:9010/SonarQube] can not be reached
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 0.915s
Final Memory: 5M/123M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Unable to execute SonarQube
ERROR: Caused by: Fail to get bootstrap index from server
ERROR: Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ERROR: Caused by: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ERROR: Caused by: unable to find valid certification path to requested target
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
script returned exit code 1
Thank you for the quick replay.
We tried it now and indeed the SonarQube scanner step is working now using the HTTPS URL, but the quality gate step is still outputting the same error:
Checking status of SonarQube task 'AW-pNa3TdGoyfBmcrPB9' on server 'SonarQubeServer'
Fail to request https://ourhost:9010/SonarQube/api/ce/task?id=AW-pNa3TdGoyfBmcrPB9
We have got the same/a simular problem:
The scan works fine (runs in a docker) but te quality gate keeps complaining about the certificate.
What keystore does the Quality Gate function use?
We have same issue after moving sonar to https.
Able to run sonar scanner but getting error for certificate while running âwaitForQualityGateâ.
Did you get any solutions for this?
Thanks