Immutable solution version
waitForQualityGate failing in Jenkins: server name mismatch or agent bug
Complete solution
Guide waitForQualityGate failing in Jenkins: server name mismatch or agent bug: [accepted answer]: two things to check. Context: Stack Overflow #42909439 (accepted answer, 14 votes): a Jenkins declarative pipeline fails at waitForQualityGate with "SonarQube installation defined. Use this when you hit exactly this in waitForQualityGate failing in Jenkins. Not for different errors or different tools.
TL;DR: [accepted answer]: two things to check. Context: Stack Overflow #42909439 (accepted answer, 14 votes): a Jenkins declarative pipeline fails at waitForQualityGate with "SonarQube installation defined in this job does not match any configured installation". The asker renamed the server in Jenkins config to match the Jenkinsfile and got a different error; the thread found the real cause in the scanner plugin.
Fix
[accepted answer]: two things to check. Expected: this specific failure stops.
Details
Context: Stack Overflow #42909439 (accepted answer, 14 votes): a Jenkins declarative pipeline fails at waitForQualityGate with "SonarQube installation defined in this job does not match any configured installation". The asker renamed the server in Jenkins config to match the Jenkinsfile and got a different error; the thread found the real cause in the scanner plugin. First, the name passed to withSonarQubeEnv in the Jenkinsfile must exactly match a server name configured under Jenkins global SonarQube servers; a mismatch produces the "does not match any configured installation" error. Second, there was a genuine bug in the SonarQube Jenkins scanner plugin (tracked as SONARJNKNS-282): waitForQualityGate failed when the job ran on a Jenkins agent/slave instead of the master. The fix was upgrading to scanner plugin v2.61 or newer. A working stage looks like this: stage("SonarQube analysis") { steps { withSonarQubeEnv("YourServerName") { sh "[path-to]/sonar-scanner" } def qg = waitForQualityGate() if (qg.status != "OK") { error "Pipeline aborted due to quality gate failure" } } } If waitForQualityGate fails only on agents but works on the master, it is the plugin bug: upgrade, dont rename things.
When to use
You hit exactly this: waitForQualityGate failing in Jenkins: server name mismatch or agent bug in waitForQualityGate failing in Jenkins.
When not to use
A different error, or the same symptom in a different tool. This page only covers the failure above.
Compatibility
waitForQualityGate failing in Jenkins (versions mentioned here: v2.61, v2).
Evidence
Stack Overflow #42909439 (accepted answer, 14 votes): a Jenkins declarative pipeline fails at waitForQualityGate with "SonarQube installation defined in this job does not match any configured installation". The asker renamed the server in Jenkins config to match the Jenkinsfile and got a different error; the thread found the real cause in the scanner plugin.
Verified resolution: [accepted answer]: two things to check. First, the name passed to withSonarQubeEnv in the Jenkinsfile must exactly match a server name configured under Jenkins global SonarQube servers; a mismatch produces the "does not match any configured installation" error. Second, there was a genuine bug in the SonarQube Jenkins scanner plugin (tracked as SONARJNKNS-282): waitForQualityGate failed when the job ran on a Jenkins agent/slave instead of the master. The fix was upgrading to scanner plugin v2.61 or newer. A working stage looks like this:
stage("SonarQube analysis") { steps { withSonarQubeEnv("YourServerName") { sh "[path-to]/sonar-scanner" } def qg = waitForQualityGate() if (qg.status != "OK") { error "Pipeline aborted due to quality gate failure" } } }
If waitForQualityGate fails only on agents but works on the master, it is the plugin bug: upgrade, dont rename things.
Source: https://stackoverflow.com/questions/42909439
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_8Vu7LJPyrPlShKx3vs3lxg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">waitForQualityGate failing in Jenkins: server name mismatch or agent bug <span>— Vectle</span></a>