-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 6.2
-
Fix Version/s: 6.4
-
Component/s: Database, Quality Gate
-
Labels:
The migration that remove quality gate conditions on IT/overall coverage is failing when the same metric is used in 2 conditions : one using absolute value and one using over leak period criteria.
The stacktrace is :
2017.03.14 10:40:27 ERROR web[][o.s.s.p.d.m.DatabaseMigrator] Fail to execute database migration: org.sonar.db.version.v62.UpdateQualityGateConditionsOnCoverage java.lang.IllegalArgumentException: Duplicate key 72 at org.sonar.core.util.stream.Collectors.putAndFailOnDuplicateKey(Collectors.java:270) at org.sonar.core.util.stream.Collectors.lambda$uniqueIndex$8(Collectors.java:247) at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at org.sonar.db.version.v62.UpdateQualityGateConditionsOnCoverage$Migration.processQualityGate(UpdateQualityGateConditionsOnCoverage.java:100) at java.util.ArrayList.forEach(ArrayList.java:1249) at org.sonar.db.version.v62.UpdateQualityGateConditionsOnCoverage$Migration.execute(UpdateQualityGateConditionsOnCoverage.java:94) at org.sonar.db.version.v62.UpdateQualityGateConditionsOnCoverage.execute(UpdateQualityGateConditionsOnCoverage.java:77) at org.sonar.db.version.BaseDataChange.execute(BaseDataChange.java:45) at org.sonar.server.platform.db.migrations.DatabaseMigrator.executeMigration(DatabaseMigrator.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:455) at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:316) at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:61) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170) at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:198) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170) at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:161) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:190) at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:81) at org.jruby.RubyClass.finvoke(RubyClass.java:527) at org.jruby.RubyBasicObject.send(RubyBasicObject.java:2590) at org.jruby.RubyKernel.send(RubyKernel.java:2223) at org.jruby.RubyKernel$INVOKER$s$send.call(RubyKernel$INVOKER$s$send.gen) at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:350) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170) at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36) at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112) at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:384) at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:303) at org.jruby.runtime.InterpretedBlock.yieldSpecific(InterpretedBlock.java:229) at org.jruby.runtime.Block.yieldSpecific(Block.java:111) at org.jruby.ast.ZYieldNode.interpret(ZYieldNode.java:25) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.ast.BlockNode.interpret(BlockNode.java:71) at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:161) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:190) at org.jruby.internal.runtime.methods.WrapperMethod.call(WrapperMethod.java:74) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:316) at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:145) at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:154) at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64) at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.ast.BlockNode.interpret(BlockNode.java:71) at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:204) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:206) at org.jruby.RubyClass.finvoke(RubyClass.java:567) at org.jruby.RubyBasicObject.send(RubyBasicObject.java:2595) at org.jruby.RubyKernel.send(RubyKernel.java:2227) at org.jruby.RubyKernel$INVOKER$s$send.call(RubyKernel$INVOKER$s$send.gen) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:356) at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:213) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:217) at org.jruby.ast.CallSpecialArgBlockPassNode.interpret(CallSpecialArgBlockPassNode.java:66) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.ast.RescueNode.executeBody(RescueNode.java:221) at org.jruby.ast.RescueNode.interpret(RescueNode.java:116) at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:198) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170) at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.ast.BlockNode.interpret(BlockNode.java:71) at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112) at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:384) at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:336) at org.jruby.runtime.BlockBody.call(BlockBody.java:73) at org.jruby.runtime.Block.call(Block.java:101) at org.jruby.RubyProc.call(RubyProc.java:290) at org.jruby.RubyProc.call(RubyProc.java:224) at org.jruby.RubyProc$INVOKER$i$0$0$call.call(RubyProc$INVOKER$i$0$0$call.gen) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:202) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:198) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136) at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.ast.IfNode.interpret(IfNode.java:118) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:161) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:190) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:316) at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:145) at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:154) at org.jruby.ast.FCallNoArgBlockNode.interpret(FCallNoArgBlockNode.java:32) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.ast.RescueNode.executeBody(RescueNode.java:221) at org.jruby.ast.RescueNode.interpret(RescueNode.java:116) at org.jruby.ast.BeginNode.interpret(BeginNode.java:83) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.ast.BlockNode.interpret(BlockNode.java:71) at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112) at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:384) at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:357) at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:312) at org.jruby.runtime.Block.yield(Block.java:142) at org.jruby.RubyArray.eachCommon(RubyArray.java:1606) at org.jruby.RubyArray.each(RubyArray.java:1613) at org.jruby.RubyArray$INVOKER$i$0$0$each.call(RubyArray$INVOKER$i$0$0$each.gen) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:316) at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:145) at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:154) at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.ast.BlockNode.interpret(BlockNode.java:71) at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:182) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136) at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:225) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:214) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:346) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:204) at org.jruby.ast.FCallTwoArgNode.interpret(FCallTwoArgNode.java:38) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.ast.WhenOneArgNode.whenNoTest(WhenOneArgNode.java:27) at org.jruby.ast.WhenOneArgNode.when(WhenOneArgNode.java:45) at org.jruby.ast.CaseNode.interpret(CaseNode.java:132) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:198) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170) at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:182) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136) at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:112) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:164) at RbCallUpgrade_875656345.callUpgrade(RbCallUpgrade_875656345.gen:13) at org.sonar.server.platform.db.migrations.PlatformDatabaseMigration.doUpgradeDb(PlatformDatabaseMigration.java:126) at org.sonar.server.platform.db.migrations.PlatformDatabaseMigration.doDatabaseMigration(PlatformDatabaseMigration.java:108) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 2017.03.14 10:40:27 INFO web[][o.s.s.p.d.m.PlatformDatabaseMigration] DB migration failed | time=612ms 2017.03.14 10:40:27 ERROR web[][o.s.s.p.d.m.PlatformDatabaseMigration] DB Migration or container restart failed. Process ended with an exception org.jruby.exceptions.RaiseException: (StandardError) An error has occurred, all later migrations canceled: Fail to execute database migration: org.sonar.db.version.v62.UpdateQualityGateConditionsOnCoverage
- relates to
-
SONAR-8283 Data migration after removall of IT/overall coverage
-
- Closed
-