0

We have recently upgraded to Sonar 5.3 from 4.4.1 and seen duplicate key issue with one of our projects. I checked the collation and found database server and database to be case insensitive and column to be case sensitive. Should we change collation on the database to "Latin1_General_CS_AS" ? Changing the collation on the server is bit difficult but we can try with database.

SELECT SERVERPROPERTY('COLLATION')

Output: Latin1_General_CI_AS

SELECT DATABASEPROPERTYEX('<SonarDatabaseName>', 'Collation') SQLCollation;

Output: Latin1_General_CI_AS

For the column, it is "Laitn1_General_CS_AS"

Error in sonar log. I did see a duplicate key in the table but not sure if this is due to collation as reported here Duplicate key error with SonarQube 5.2:

            ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVM28yZdM8YcgYQ_GJuI
            org.sonar.server.computation.component.VisitException: Visit failed for Component
            .
            .
            ### Error updating database.  Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert duplicate key row in object 'dbo.projects' with unique index 'projects_kee'.

Thanks in advance.

Community
  • 1
  • 1
AmitP
  • 21
  • 4

1 Answers1

1

Case sensitivity is a requirement, so yes you really need to change the collation of this database (putting it case-sensitive (CS) and accent-sensitive (AS)).

Nicolas B.
  • 7,245
  • 17
  • 29
  • hi, Is this just a requirement for Sonar 5.3 or 4.5+ versions? Our environment was working fine with 4.4.1. – AmitP Mar 07 '16 at 12:42
  • No it has been a requirement for a very long time (including [in 4.4](http://docs.sonarqube.org/display/SONARQUBE44/Requirements)). Might have slipped through the crack for you, but ultimately it must be CS/AS. – Nicolas B. Mar 07 '16 at 13:07
  • See the [docs](http://docs.sonarqube.org/display/SONAR/Installing+the+Server) and [change 6884 for Sonar 5.3](https://jira.sonarsource.com/browse/SONAR-6884) – Jeroen Heier Mar 07 '16 at 20:51
  • Thanks for the help. I am trying to test this in staging environment before changing the collation for Prod. :) – AmitP Mar 16 '16 at 11:35