使用NullPointerException,数据库迁移从Sonar 4.5.1到Sonar 5.0.1失败

时间:2015-03-19 19:44:40

标签: sonarqube sonarqube-5.0

我从Sonar 4.5.1升级到5.0.1时遇到了问题。数据库迁移步骤失败,"错误查询数据库。" "原因:Java.lang.NullPointerException。"

有谁知道如何继续找到问题的原因?我已经在Failed to upgrade SonarQube from 4.5.2 to 5.0 post中尝试了无范围项目的查询。我的错误与本文中的错误非常相似。 我还尝试了How to find 'active' snapshots that cause sonarqube upgrade 5.0 to fail的活动快照脚本,但没有返回任何内容。有谁知道我还能尝试什么才能找到问题?

系统信息:

  • OS:Linux / amd64 / 2.6.32-431.el6.x86_64
  • 声纳版本:4.5.1
  • Java版本1.7.0_51-b13
  • 数据库Oracle Oracle Database 11g企业版
  • 数据库驱动程序Oracle JDBC驱动程序11.2.0.3

错误日志:

2015.03.10 17:06:36 INFO  RubyThread-9: /opt/sonar/sonar-5.0.1/web/WEB-INF/app/models/database_migration_manager.rb:102 web[sql]  2ms Executed SQL: SELECT version FROM schema_migrations
2015.03.10 17:06:36 INFO  RubyThread-9: /opt/sonar/sonar-5.0.1/web/WEB-INF/app/models/database_migration_manager.rb:102 web[DbMigration]  ==  PopulateProjectsUuidColumns: migrating ====================================
2015.03.10 17:06:37 INFO  RubyThread-9: /opt/sonar/sonar-5.0.1/web/WEB-INF/app/models/database_migration_manager.rb:102 web[sql]  358ms Executed SQL: SELECT p.id AS "id", p.uuid AS "uuid", p.project_uuid AS "projectUuid", s.root_project_id AS "projectId", s.id AS "snapshotId", s.path AS "snapshotPath", p.scope AS "scope" FROM projects p LEFT OUTER JOIN snapshots s ON s.project_id = p.id AND s.islast = 1 WHERE p.scope = 'PRJ' AND p.root_id IS NULL
2015.03.10 17:06:37 INFO  RubyThread-9: /opt/sonar/sonar-5.0.1/web/WEB-INF/app/models/database_migration_manager.rb:102 web[sql]  9ms Executed SQL: SELECT p.id AS "id", p.uuid AS "uuid", p.project_uuid AS "projectUuid", p.module_uuid AS "moduleUuid", p.module_uuid_path AS "moduleUuidPath", s.root_project_id AS "projectId", s.id AS "snapshotId", s.path AS "snapshotPath", p.scope AS "scope" FROM projects root INNER JOIN snapshots root_snapshot ON root_snapshot.project_id = root.id AND root_snapshot.islast = 1 INNER JOIN snapshots s ON s.root_snapshot_id = root_snapshot.id AND s.islast = 1 INNER JOIN projects p ON p.id = s.project_id WHERE root.id = ? - parameters are: <12700>
2015.03.10 17:06:38 INFO  RubyThread-9: /opt/sonar/sonar-5.0.1/web/WEB-INF/app/models/database_migration_manager.rb:102 web[sql]  5ms Executed SQL: SELECT p.id AS "id", p.uuid AS "uuid" FROM projects p INNER JOIN projects root ON root.id = p.root_id WHERE root.id = ? AND p.uuid IS NULL AND p.enabled=0 - parameters are: <12700>
2015.03.10 17:06:38 INFO  RubyThread-9: /opt/sonar/sonar-5.0.1/web/WEB-INF/app/models/database_migration_manager.rb:102 web[sql]  3ms Executed SQL: SELECT p.id AS "id", p.uuid AS "uuid" FROM projects p INNER JOIN projects root_one ON root_one.id = p.root_id INNER JOIN projects root_two ON root_two.id = root_one.root_id WHERE root_two.id=? AND p.uuid IS NULL AND p.enabled=0 - parameters are: <12700>
2015.03.10 17:06:38 INFO  RubyThread-9: /opt/sonar/sonar-5.0.1/web/WEB-INF/app/models/database_migration_manager.rb:102 web[sql]  2ms Executed SQL: SELECT p.id AS "id", p.uuid AS "uuid", p.project_uuid AS "projectUuid", p.module_uuid AS "moduleUuid", p.module_uuid_path AS "moduleUuidPath", s.root_project_id AS "projectId", s.id AS "snapshotId", s.path AS "snapshotPath", p.scope AS "scope" FROM projects root INNER JOIN snapshots root_snapshot ON root_snapshot.project_id = root.id AND root_snapshot.islast = 1 INNER JOIN snapshots s ON s.root_snapshot_id = root_snapshot.id AND s.islast = 1 INNER JOIN projects p ON p.id = s.project_id WHERE root.id = ? - parameters are: <12677>
2015.03.10 17:06:38 ERROR RubyThread-9: /opt/sonar/sonar-5.0.1/web/WEB-INF/app/models/database_migration_manager.rb:102 web[o.s.s.d.m.DatabaseMigrator]  Fail to execute database migration: org.sonar.server.db.migrations.v50.PopulateProjectsUuidColumnsMigration
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.1.jar:na]
    at org.sonar.server.db.migrations.v50.PopulateProjectsUuidColumnsMigration.execute(PopulateProjectsUuidColumnsMigration.java:65) ~[sonar-server-5.0.1.jar:na]
    at org.sonar.server.db.migrations.DatabaseMigrator.executeMigration(DatabaseMigrator.java:94) ~[sonar-server-5.0.1.jar:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_75]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_75]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_75]
    at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_75]
    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]

0 个答案:

没有答案