我正在从Sonarqube 4.5.2升级到5.3,并且数据库迁移失败。我在使用MySQL的RH-Linux上运行。运行7小时后,我得到了以下堆栈跟踪。数据库的状态是什么?我下一步要做什么?
2016.02.29 18:36:16 INFO web[o.s.d.v.MassUpdate] 114749 issue_changes processed
(183 items/sec)
2016.02.29 18:37:09 ERROR web[o.s.s.d.m.DatabaseMigrator] Fail to execute databa
se migration: org.sonar.db.version.v51.FeedIssueChangesLongDates
java.lang.IllegalStateException: Error during processing of row: [created_at=201
5-07-01 23:54:59.0,updated_at=2015-07-01 23:54:59.0,issue_change_creation_date=2
015-07-01 23:28:45.0,id=1418038]
at org.sonar.db.version.SelectImpl.newExceptionWithRowDetails(SelectImpl
.java:89) ~[sonar-db-5.3.jar:na]
at org.sonar.db.version.SelectImpl.scroll(SelectImpl.java:81) ~[sonar-db
-5.3.jar:na]
at org.sonar.db.version.MassUpdate.execute(MassUpdate.java:76) ~[sonar-d
b-5.3.jar:na]
at org.sonar.db.version.v51.FeedIssueChangesLongDates.execute(FeedIssueC
hangesLongDates.java:49) ~[sonar-db-5.3.jar:na]
at org.sonar.db.version.BaseDataChange.execute(BaseDataChange.java:45) ~
[sonar-db-5.3.jar:na]
at org.sonar.server.db.migrations.DatabaseMigrator.executeMigration(Data
baseMigrator.java:95) ~[sonar-server-5.3.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.
0_72]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57) ~[na:1.7.0_72]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43) ~[na:1.7.0_72]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_72]
at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(Ja
vaMethod.java:455) [jruby-complete-1.7.9.jar:na]
at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:316) [j
ruby-complete-1.7.9.jar:na]
at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvo
ker.java:61) [jruby-complete-1.7.9.jar:na]
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:
168) [jruby-complete-1.7.9.jar:na]
:
:
:
2016.02.29 18:37:09 INFO web[o.s.s.d.m.PlatformDatabaseMigration] DB migration failed | time=25048064ms
2016.02.29 18:37:09 ERROR web[o.s.s.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.v51
.FeedIssueChangesLongDates
最佳答案
您必须还原备份。希望您在开始升级之前就做好了。搜索FeedIssueChangesLongDates可以找到here实现。查看查询和对找到的记录执行的操作。基于此,您可以调查有问题的记录并直接在SQL中更正/更新。