Quality gates not working in community edition

I have recently upgraded the demo version of the community edition to use an Azure SQL DB. All of my projects are working just fine, syncing with both Visual Studio and Azure DevOps.

I previously had a quality gate that I wanted to rebuild (braindead simple: bug count lower than 4 in new code), but every time I try to create the rule I see a red box with an error message (an error occured please contact your administrator). This happens regardless of whether I’m logged in as a user or the admin.

Anybody’s got any idea as to what the problem could be and/or where to look?


Hello! Was version of SonarQube are you using?

More details about the error are probably visible in {{web.log}}


it’s Community Edition version 7.9.

Here’s what I found in the log:

2019.07.26 09:24:34 ERROR web[AWwYf961uoLKSL/1ABX/][o.s.s.w.WebServiceEngine] Fail to process request http://sonarqube-bbddevopstools.azurewebsites.net/api/qualitygates/search?gateId=5&page=1&pageSize=100&selected=selected
### Error querying database.  Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'key'.
### The error may exist in org.sonar.db.qualitygate.ProjectQgateAssociationMapper
### The error may involve org.sonar.db.qualitygate.ProjectQgateAssociationMapper.selectProjects-Inline
### The error occurred while setting parameters
### SQL: SELECT proj.id as id, proj.kee as key, proj.name as name, prop.text_value as gateId     FROM projects proj     LEFT JOIN properties prop ON prop.resource_id=proj.id AND prop.prop_key='sonar.qualitygate' AND prop.text_value = ?     where     proj.qualifier = 'TRK'     and proj.enabled = 1     and proj.main_branch_project_uuid is null     and proj.copy_component_uuid is null     and proj.organization_uuid=?               and prop.text_value IS NOT NULL                   order by proj.name
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'key'.

It seems to be a SQL update error, but I’m not sure if I can do something about it.


Aha. This was an early v7.9 bug that was caught right after release and fixed in v7.9.1 :slight_smile: https://jira.sonarsource.com/browse/SONAR-12261

Downloading that version should get you back in business.


Ahhh… Great! I have a pending “A new version of SonarQube is available” that might actually be a good idea to to do now!

Thanks much!

/// Bjarne