如何找到活跃的'导致sonarqube升级到5.0失败的快照?

时间:2015-02-18 16:04:20

标签: database oracle sonarqube upgrade sonarqube-5.0

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

Failed to upgrade SonarQube from 4.5 to 5.0.1

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)。 此用例   不管理,因为这不应该发生

如何识别上述“活动”快照并将其删除,以便此步骤成功?

1 个答案:

答案 0 :(得分:0)

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

  

SELECT snapshots.id,COUNT()FROM项目INNER JOIN快照开启   snapshots.project_id = projects.id AND snapshots.islast = true GROUP BY       snapshots.id HAVING       COUNT()> 1