无法执行数据库迁移:org.sonar.db.version.v60.PopulateProfileKeyOfActivities

时间:2016-08-12 13:02:25

标签: mysql sonarqube sonarqube5.1 sonarqube-ops

我正在尝试从SonarQube 5.2升级到6.0。

我使用了升级指南但是我遇到了数据库迁移错误。

ERROR web[o.s.s.d.m.DatabaseMigrator] Fail to execute database migration: org.sonar.db.version.v60.PopulateProfileKeyOfActivities
 at org.sonar.db.version.SelectImpl.newExceptionWithRowDetails(SelectImpl.java:89) ~[sonar-db-6.0.jar:na]
  at org.sonar.db.version.SelectImpl.scroll(SelectImpl.java:81) ~[sonar-db-6.0.jar:na]
  at org.sonar.db.version.MassUpdate.execute(MassUpdate.java:91) ~[sonar-db-6.0.jar:na]
  at org.sonar.db.version.v60.PopulateProfileKeyOfActivities.execute(PopulateProfileKeyOfActivities.java:47) ~[sonar-db-6.0.jar:na]
  at org.sonar.db.version.BaseDataChange.execute(BaseDataChange.java:45) ~[sonar-db-6.0.jar:na]
  at org.sonar.server.db.migrations.DatabaseMigrator.executeMigration(DatabaseMigrator.java:95) ~[sonar-server-6.0.jar:na]
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_65]
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_65]
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_65]
  at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_65]
  at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:455) [jruby-complete-1.7.9.jar:na]
  at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:316) [jruby-complete-1.7.9.jar:na]
  at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:61) [jruby-complete-1.7.9.jar:na]
  at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326) [jruby-complete-1.7.9.jar:na]
  at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170) [jruby-complete-1.7.9.jar:na]
  at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57) [jruby-complete-1.7.9.jar:na]
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) [jruby-complete-1.7.9.jar:na]
  at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74) [jruby-complete-1.7.9.jar:na]
  at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182) [jruby-complete-1.7.9.jar:na]
  at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:198) [jruby-complete-1.7.9.jar:na]
  at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326) [jruby-complete-1.7.9.jar:na]
  at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170) [jruby-complete-1.7.9.jar:na]
  at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36) [jruby-complete-1.7.9.jar:na]
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) [jruby-complete-1.7.9.jar:na]
  at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74) [jruby-complete-1.7.9.jar:na]
  at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:161) [jruby-complete-1.7.9.jar:na]
  at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:190) [jruby-complete-1.7.9.jar:na]
  at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:81) [jruby-complete-1.7.9.jar:na]
  at org.jruby.RubyClass.finvoke(RubyClass.java:527) [jruby-complete-1.7.9.jar:na]
  at org.jruby.RubyBasicObject.send(RubyBasicObject.java:2590) [jruby-complete-1.7.9.jar:na]
  at org.jruby.RubyKernel.send(RubyKernel.java:2223) [jruby-complete-1.7.9.jar:na]
  at org.jruby.RubyKernel$INVOKER$s$send.call(RubyKernel$INVOKER$s$send.gen) [jruby-complete-1.7.9.jar:na]
  at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:350) [jruby-complete-1.7.9.jar:na]
  at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326) [jruby-complete-1.7.9.jar:na]
  at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170) [jruby-complete-1.7.9.jar:na]
  at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36) [jruby-complete-1.7.9.jar:na]
  at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123) [jruby-complete-1.7.9.jar:na]
  at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105) [jruby-complete-1.7.9.jar:na]
  at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112) [jruby-complete-1.7.9.jar:na]
  at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:384) [jruby-complete-1.7.9.jar:na]
  at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:303) [jruby-complete-1.7.9.jar:na]
  at org.jruby.runtime.InterpretedBlock.yieldSpecific(InterpretedBlock.java:229) [jruby-complete-1.7.9.jar:na]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_65]
  at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_65]
Caused by: java.lang.IllegalStateException: No profile key found in db row of activities.data_field [5993]
  at com.google.common.base.Preconditions.checkState(Preconditions.java:197) ~[guava-18.0.jar:na]
  at org.sonar.db.version.v60.PopulateProfileKeyOfActivities.handle(PopulateProfileKeyOfActivities.java:55) ~[sonar-db-6.0.jar:na]
  at org.sonar.db.version.MassUpdate.callSingleHandler(MassUpdate.java:117) ~[sonar-db-6.0.jar:na]
  at org.sonar.db.version.MassUpdate.lambda$execute$0(MassUpdate.java:91) ~[sonar-db-6.0.jar:na]
  at org.sonar.db.version.SelectImpl.scroll(SelectImpl.java:78) ~[sonar-db-6.0.jar:na]
  ... 161 common frames omitted

我正在使用mySQL 5.7。

有什么建议吗?

1 个答案:

答案 0 :(得分:2)

由于存在L.T.S,因此无法从5.2直接升级到6.0。版本,5.6,之间。尝试:

  • 将数据库还原到迁移前尝试状态
  • 从5.2升级到5.6.1
  • 从5.6.1升级到6.0