Sonarqube quality gate status check fail/pass in Jenkins pipeline

Hi
I am using below Jenkins and SonarQube version.

Jenkins: - 2.73.3
SonarQube: - 6.7

I want to update the Sonarqube quality gate status on jenkins pipeline if QG is fail than Jenkins job should be failed. I have used below configuration in our Jenkins pipeline.

  stage("Quality Gate") {
        steps {
          timeout(time: 3, unit: 'MINUTES') {
            waitForQualityGate abortPipeline: true
          }
        }
      }

after implementing above configuration in Jenkins pipeline getting below error.

Please confirm if i have to use some another configration.

You haven’t added the error.

Are you really using Jenkins 2.73.3? That version is almost 7 years old and has many security vulnerabilities.

I have added error snap.

Well most likely the parameter abortPipeline was added in a newer version of the plugin that requires a newer Jenkins verison. So you should update Jenkins to latest LTS and update all plugins to latest version for that LTS.

Hi Markus

Thanks for quick response.

As we cannot upgrade Jenkins now, so is there any alternative way to implement this feature in old Jenkins.

Only the hard way by checking out the sources of the sonar plugin and see if you can get the current code compiled against your old version. Or checkout the version you use and try to reimplement that particular feature.
Maybe there is another way of finding out if you need to abort by doing http requests to a server. but I have no idea how that could look like.

Hi Markus.
Now i am using below Jenkins and SonarQube version.

Jenkins: - 2.440.2
SonarQube: - 9.9.5

I want to update the Sonarqube quality gate status on jenkins pipeline if QG is fail than Jenkins job should be failed. I have used below configuration in our Jenkins pipeline.

stage(“Quality Gate”) {
steps {
timeout(time: 3, unit: ‘MINUTES’) {
waitForQualityGate abortPipeline: true
}
}
}
After successfully analysis QG is showing passed in sonarqube dashboard but still not getting the correct response on Jenkins pipeline.

The 3 minutes for the timeout step seem to be not sufficient.

Hi Markus,
I have also tried with timeout to 15 Minutes. But still issue is same.

As I’m not using sonarqube I can’t provide more help.
Maybe it is possible to configure a logrecorder for the plugin that allows to see more details.