0

我遇到了与 Julien Lancelot 回答的错误相同的错误:

无法将 SonarQube 从 4.5 升级到 5.0.1

IE

2015.02.18 14:56:26 INFO  web[DbMigration]  ==  PopulateProjectsUuidColumns: migrating ====================================
2015.02.18 14:56:43 ERROR web[o.s.s.d.m.DatabaseMigrator]  Fail to execute database migration: org.sonar.server.db.migrations.v50.PopulateProjectsUuidColum
nsMigration
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: java.lang.NullPointerException
### Cause: java.lang.NullPointerException
        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26) ~[mybatis-3.2.7.jar:3.2.7]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.select(DefaultSqlSession.java:130) ~[mybatis-3.2.7.jar:3.2.7]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.select(DefaultSqlSession.java:122) ~[mybatis-3.2.7.jar:3.2.7]
        at org.sonar.core.persistence.DbSession.select(DbSession.java:125) ~[sonar-core-5.0.jar:na]
        at org.sonar.server.db.migrations.v50.PopulateProjectsUuidColumnsMigration.execute(PopulateProjectsUuidColumnsMigration.java:65) ~[sonar-server-5.0.jar:na]

朱利安提到

在 SQL 查询和修改后的 jar 的帮助下添加了一些调试,我终于找到了问题所在:您的 id 为 39554 的项目有 2 个活动快照(1234385 和 1234386)。这个用例没有被管理,因为这永远不会发生

如何识别提到的“活动”快照并删除它们以便此步骤成功?

4

1 回答 1

0

Julian 通过电子邮件回答,这里是 sql

SELECT snapshots.id, COUNT( ) FROM projects INNER JOIN snapshots ON snapshots.project_id=projects.id AND snapshots.islast=true GROUP BY snapshots.id HAVING COUNT( ) > 1

于 2015-02-19T10:58:31.783 回答