Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
341 views
in Technique[技术] by (71.8m points)

c# - Duplicate key error with SonarQube 5.2

I've been trying out SonarQube 5.2, but I'm getting errors such as these:

org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  
Cause:com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert duplicate key row in object 'dbo.projects' with unique index 'projects_uuid'. The duplicate key value is (AVDTnvuxTcMzGBo2P2Fw).
### The error may involve org.sonar.db.component.ComponentMapper.insert-Inline
### The error occurred while setting parameters
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert duplicate key row in object 'dbo.projects' with unique index 'projects_uuid'. The duplicate key value is (AVDTnvuxTcMzGBo2P2Fw).
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.update(DefaultSqlSession.java:154) ~[mybatis-3.2.7.jar:3.2.7]
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:141) ~[mybatis-3.2.7.jar:3.2.7]
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.$Proxy65.insert(Unknown Source) ~[na:na]
at org.sonar.db.component.ComponentDao.insert(ComponentDao.java:282) ~[sonar-db-5.2.jar:na]
at org.sonar.server.computation.step.PersistComponentsStep$PersistComponentStepsVisitor.persistComponent(PersistComponentsStep.java:172) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.step.PersistComponentsStep$PersistComponentStepsVisitor.persistAndPopulateCache(PersistComponentsStep.java:164) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.step.PersistComponentsStep$PersistComponentStepsVisitor.visitModule(PersistComponentsStep.java:130) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.PathAwareCrawler.visitNode(PathAwareCrawler.java:83) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.PathAwareCrawler.visit(PathAwareCrawler.java:51) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.PathAwareCrawler.visitChildren(PathAwareCrawler.java:71) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.component.PathAwareCrawler.visit(PathAwareCrawler.java:54) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.step.PersistComponentsStep.execute(PersistComponentsStep.java:77) ~[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]

This only occurs if the solution I'm trying to analyse has more than one project. The same projects analyze just fine with SonarQube 5.1.2. I have the following configuration:

  • SonarQube 5.2 (with a SQL Server 2012 database)
  • C# 4.3
  • Java 3.7
  • LDAP 1.5
  • Git 1.1
  • SVN 1.2
  • JavaScript 2.8

Anyone else ran into this problem?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The issue is coming from the fact that db and tables must be case sensitive.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...