SonarCloud Quality Gate Intergration with Jenkins Fails

Dear Community,

We are integrating SonarCloud Quality gets with our projects in Jenkins, and during the integration, we see the below errors. We used the Project Key and the Access Token from the SonarCloud Project in Jenkins Quality Gate Plugin. Any help will be appreciated.

PS - SonarCloud scan is a success for that particular project.

Template for a good new topic, formatted with Markdown:

  • ALM used Bitbucket Cloud
  • CI system used Jenkins
  • Languages of the repository - JAVA
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeed?
quality.gates.jenkins.plugin.QGException: Expected status 200, got: 401. Response:
        at quality.gates.sonar.api.SonarHttpRequester.executeGetRequest(
        at quality.gates.sonar.api.SonarHttpRequester.getAPIInfo(
        at quality.gates.sonar.api.QualityGatesProvider.getRequesterResult(
        at quality.gates.sonar.api.QualityGatesProvider.getAPIResultsForQualityGates(
        at quality.gates.jenkins.plugin.BuildDecision.getStatus(
        at quality.gates.jenkins.plugin.QGPublisher.perform(
        at hudson.tasks.BuildStepMonitor$1.perform(
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(
        at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(
        at hudson.model.Build$BuildExecution.post2(
        at hudson.model.AbstractBuild$
        at hudson.model.Run.execute(
        at hudson.model.ResourceController.execute(
Build step 'Quality Gates' marked build as failure
Finished: FAILURE
  • Steps to reproduce
    Add Project Key and Access Token to the Quality Gate plugin in Jenkins

Hey there.

It looks like the stacktrace comes from the Quality Gates Jenkins plugin which is very old and was never maintained by Sonar.

I would recommend instead using the Jenkins Extension for SonarCloud