【问题标题】:SonarQube upgrade fails from v5.1 to v5.2SonarQube 从 v5.1 升级到 v5.2 失败
【发布时间】:2016-02-06 16:38:36
【问题描述】:

我正在尝试将 SonarQube v5.1 升级到 v5.2,但失败并出现以下错误:

ERROR web[o.s.s.d.m.DatabaseMigrator] Fail to execute database migration: org.sonar.db.version.v52.RemoveDuplicatedComponentKeys
java.lang.IllegalStateException: Error during processing of row:..................................................................

Caused by: java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@7f872fa8 is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries.

2015.11.05 09:08:32 INFO  web[o.s.s.d.m.PlatformDatabaseMigration] DB migration failed | time=6911ms
2015.11.05 09:08:32 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.v52.RemoveDuplicatedComponentKeys

【问题讨论】:

  • 这个问题有什么进展吗?我从 5.0 升级到 5.2 时遇到同样的问题。
  • 我以后没有尝试升级。 SonarQube 发布了 5.3 版,看起来这个问题在升级中得到了解决。 jira.sonarsource.com/browse/SONAR-7137

标签: sonarqube sonarqube5.1


【解决方案1】:

我找到了解决方法。我已经从项目表中删除了重复的项目,然后重新开始了迁移过程。

要了解发生了什么,请在您的数据库上执行以下查询:

select p.kee, COUNT(p.kee) FROM projects p GROUP BY p.kee HAVING COUNT(p.kee) > 1;

如果此查询返回任何元素,则必须删除重复的元素(例如最旧的元素)。就我而言,这很容易,因为我在问题表中没有与相关项目相关的问题。

您必须逐步模仿 SonarQube 5.2 迁移过程(删除重复的项目并为它们更新问题),您可以在 Github 上找到迁移步骤期间正在执行的查询列表。

【讨论】:

    猜你喜欢
    • 2015-07-06
    • 1970-01-01
    • 1970-01-01
    • 2015-07-06
    • 2016-09-15
    • 2017-07-07
    • 2023-03-26
    • 2015-05-08
    • 2018-06-25
    相关资源
    最近更新 更多