Qualitygate ERROR

org.quality.gates.jenkins.plugin.QGException: Expected status 200, got: 400. Response: {“errors”:[{“msg”:“The \u0027component\u0027 parameter is missing”}]}

  • at org.quality.gates.sonar.api.SonarHttpRequester.executeGetRequest(SonarHttpRequester.java:124)*
  • at org.quality.gates.sonar.api.SonarHttpRequester.getComponentId(SonarHttpRequester.java:182)*
  • at org.quality.gates.sonar.api60.SonarHttpRequester60.getSonarApiTaskInfoParameter(SonarHttpRequester60.java:39)*
  • at org.quality.gates.sonar.api.SonarHttpRequester.getAPITaskInfo(SonarHttpRequester.java:145)*
  • at org.quality.gates.sonar.api.QualityGatesProvider.getAPIResultsForQualityGates(QualityGatesProvider.java:62)*
  • at org.quality.gates.jenkins.plugin.BuildDecision.getStatus(BuildDecision.java:24)*
  • at org.quality.gates.jenkins.plugin.QGPublisher.perform(QGPublisher.java:85)*
  • at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)*
  • at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)*
  • at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)*
  • at hudson.model.Build$BuildExecution.post2(Build.java:177)*
  • at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:697)*
  • at hudson.model.Run.execute(Run.java:1931)*
  • at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)*
  • at hudson.model.ResourceController.execute(ResourceController.java:97)*
  • at hudson.model.Executor.run(Executor.java:429)*
    Build step ‘Quality Gates Sonarqube Plugin’ marked build as failure

===============================================================

Template for a good bug report, formatted with Markdown:

  • Versions used ( Sonarqube - 9.0.0 , Jenkins - 2.289.3)
  • Error observed (Please see above for error)

This isn’t happening on with Jenkins version 2.165 and Sonarqube version 7.6

Please help

Hey there.

This looks to be coming from the Sonar Quality Gates Jenkins extension which was never officially supported by SonarSource. It looks to only support old versions of SonarQube (and is no longer maintained).

I would instead recommend that you use the SonarScanner for Jenkins which includes ways to break the build on Quality Gate failure.

I would instead recommend that you use the SonarScanner for Jenkins which includes ways to break the build on Quality Gate failure.

The linked documentation doesn’t describe how to FAIL the build on a Quality Gate failure outside of using Jenkins Pipelines… but maybe I’m missing something. Can you elaborate on how to fail the build without switching over to a Pipeline?