SonarQube gate failing on new bugs, code smells, or vulnerabilities in CI
The Sonar way gate fails if new code introduces any bugs or vulnerabilities, or drops the maintainability rating. The scanner uploads fine; the gate then rejects the new issues.
What this error means
The gate lists conditions such as "0 New Bugs (required = 0)" showing a non-zero actual, or a Reliability/Maintainability rating worse than the required letter grade on new code.
QUALITY GATE STATUS: FAILED
2 New Bugs (required is 0)
Reliability Rating on New Code is C (required is A)Common causes
The change introduced new issues Sonar rules flag
A new bug, vulnerability, or code smell in the changed lines breaches the zero-new-issues conditions of the default gate.
A rule severity maps to a rating drop
A single new blocker or critical issue can push the Reliability or Security rating below the required A on new code.
How to fix it
Open each new issue and resolve it
- On the dashboard, filter Issues to New Code period.
- Fix each new bug or vulnerability, or address the code smell the rule describes.
- If an issue is a genuine false positive, mark it resolved with a reason rather than disabling the gate.
Tune noisy rules at the quality profile level
If a specific rule is inappropriate for your codebase, deactivate it in the Quality Profile on the server so it stops flagging new code globally, not per job.
How to prevent it
- Run the analysis on pull requests so new issues surface before merge.
- Keep the quality profile curated so rules match your standards.
- Fix new issues as part of the change, not in a later cleanup.