Sonarqube analysis fails with a PersistenceException. Unable to insert duplicate key string into dbo.issues object with unique issues_kee index

This is a new installation of Sonarqube 5.2 on a Windows 2012R2 server with MS SQL Server 2012 database

Driver: Microsoft JDBC Driver 4.1 for SQL Server, Version: 4.1.5605.100

Analysis files load normally, but when processing a job I see errors like the following

2015.12.03 17:11:22 ERROR [ossctCeWorkerRunnableImpl] Failed to execute task AVFo0pZECnZ7xJR5PoU8
org.apache.ibatis.exceptions.PersistenceException: 
### Error committing transaction. Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.issue.IssueMapper.insert (batch index # 1) failed. Cause: java.sql.BatchUpdateException: Cannot insert duplicate key row in object 'dbo.issues' with unique index 'issues_kee'. The duplicate key value is (AVFo0wtzCnZ7xJR5PrRx).
### Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.issue.IssueMapper.insert (batch index # 1) failed. Cause: java.sql.BatchUpdateException: Cannot insert duplicate key row in object 'dbo.issues' with unique index 'issues_kee'. The duplicate key value is (AVFo0wtzCnZ7xJR5PrRx).
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException (ExceptionFactory.java:26) ~ [mybatis-3.2.7.jar: 3.2.7]
    at org.apache.ibatis.session.defaults.DefaultSqlSession.commit (DefaultSqlSession.java:177) ~ [mybatis-3.2.7.jar: 3.2.7]
    at org.apache.ibatis.session.defaults.DefaultSqlSession.commit (DefaultSqlSession.java:169) ~ [mybatis-3.2.7.jar: 3.2.7]
    at org.sonar.db.DbSession.commit (DbSession.java:60) ~ [sonar-db-5.2.jar: na]
    at org.sonar.db.BatchSession.commit (BatchSession.java:176) ~ [sonar-db-5.2.jar: na]
    at org.sonar.db.BatchSession.increment (BatchSession.java:213) ~ [sonar-db-5.2.jar: na]
    at org.sonar.db.BatchSession.insert (BatchSession.java:133) ~ [sonar-db-5.2.jar: na]
    at org.apache.ibatis.binding.MapperMethod.execute (MapperMethod.java:51) ~ [mybatis-3.2.7.jar: 3.2.7]
    at org.apache.ibatis.binding.MapperProxy.invoke (MapperProxy.java:52) ~ [mybatis-3.2.7.jar: 3.2.7]
    at com.sun.proxy. $ Proxy103.insert (Unknown Source) ~ [na: na]
    at org.sonar.server.computation.step.PersistIssuesStep.execute (PersistIssuesStep.java:70) ~ [sonar-server-5.2.jar: na]
    at org.sonar.server.computation.step.ComputationStepExecutor.execute (ComputationStepExecutor.java:39) ~ [sonar-server-5.2.jar: na]
    at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process (ReportTaskProcessor.java:53) ~ [sonar-server-5.2.jar: na]
    at org.sonar.server.computation.taskprocessor.CeWorkerRunnableImpl.executeTask (CeWorkerRunnableImpl.java:78) [sonar-server-5.2.jar: na]
    at org.sonar.server.computation.taskprocessor.CeWorkerRunnableImpl.run (CeWorkerRunnableImpl.java:55) [sonar-server-5.2.jar: na]
    at java.util.concurrent.Executors $ RunnableAdapter.call (Unknown Source) [na: 1.8.0_45]
    at java.util.concurrent.FutureTask.runAndReset (Unknown Source) [na: 1.8.0_45]
    at java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.access $ 301 (Unknown Source) [na: 1.8.0_45]
    at java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.run (Unknown Source) [na: 1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor.runWorker (Unknown Source) [na: 1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor $ Worker.run (Unknown Source) [na: 1.8.0_45]
    at java.lang.Thread.run (Unknown Source) [na: 1.8.0_45]

One of the projects was successful a couple of times, and I see the results on the control panel, but other projects do not work! 00% of the time

Is this a bug or something else when loading the analysis?

+4
source share

Source: https://habr.com/ru/post/1618552/


All Articles