AmitP
AmitP

Reputation: 21

Duplicate key error post SonarQube 5.3 upgrade

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.

Upvotes: 0

Views: 588

Answers (1)

Nicolas B.
Nicolas B.

Reputation: 7321

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)).

Upvotes: 1

Related Questions