Sonarqube 分析失败并出现 PersistenceException - 无法在具有唯一索引 'issues_kee' 的对象 'dbo.issues' 中插入重复键行
Sonarqube analysis fails with PersistenceException - Cannot insert duplicate key row in object 'dbo.issues' with unique index 'issues_kee'
这是 windows 服务器 2012R2 上的新 Sonarqube 5.2 安装,带有 MS SQL 服务器 2012 数据库
驱动程序:Microsoft JDBC SQL 服务器的驱动程序 4.1,版本:4.1.5605.100
分析文件上传正常,但在处理作业时我看到如下错误
2015.12.03 17:11:22 ERROR [o.s.s.c.t.CeWorkerRunnableImpl] 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.access1(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]
其中一个项目 运行 成功了几次,我可以在仪表板中看到结果,但其他项目失败了!00% 的时间
这是正在上传的分析中的错误还是什么?
尝试更改 SQL 排序规则:
https://www.mssqltips.com/sqlservertip/3519/changing-sql-server-collation-after-installation/
您必须具有 CS_AS 的排序规则。
对我有用。
这是 windows 服务器 2012R2 上的新 Sonarqube 5.2 安装,带有 MS SQL 服务器 2012 数据库
驱动程序:Microsoft JDBC SQL 服务器的驱动程序 4.1,版本:4.1.5605.100
分析文件上传正常,但在处理作业时我看到如下错误
2015.12.03 17:11:22 ERROR [o.s.s.c.t.CeWorkerRunnableImpl] 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.access1(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]
其中一个项目 运行 成功了几次,我可以在仪表板中看到结果,但其他项目失败了!00% 的时间
这是正在上传的分析中的错误还是什么?
尝试更改 SQL 排序规则: https://www.mssqltips.com/sqlservertip/3519/changing-sql-server-collation-after-installation/
您必须具有 CS_AS 的排序规则。
对我有用。