0

我正在尝试从 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。

请问有什么建议吗?

4

1 回答 1

2

您不能从 5.2 直接升级到 6.0,因为两者之间有一个 LTS 版本 5.6。尝试:

  • 将数据库恢复到迁移尝试前的状态
  • 从 5.2 升级到 5.6.1
  • 从 5.6.1 升级到 6.0
于 2016-08-12T13:08:44.517 回答