声纳 - 升级到Sonar 3.7失败

时间:2013-08-21 11:28:37

标签: database upgrade sonarqube

目前我正在运行Sonar 3.5.1安装而没有任何问题。我想升级到最新的3.7版本,但在启动安装程序后,我收到一条错误消息,说明数据库迁移失败。

消息说:

  • java.lang.IllegalStateException:无法执行数据库迁移:org.sonar.server.db.migrations.ConvertViolationsToIssues

Sonar正在运行:

  • Windows 7 Pro - x64
  • MSSQL 2008 R2数据库服务器
  • MSSQL jtds-1.2.7

other listed calls on stackoverflow中,它表示在3.7版本中有一些修复。

以下是记录的错误:


INFO   | jvm 1    | 2013/08/21 12:04:09 | ==  MigrateViolationsToIssues: migrating ======================================
2013.08.21 12:04:09 ERROR o.s.s.d.DatabaseMigrator  Fail to execute database migration: org.sonar.server.db.migrations.ConvertViolationsToIssues
java.lang.IllegalStateException: Fail to convert violations to issues
    at org.sonar.server.db.migrations.ConvertViolationsToIssues.execute(ConvertViolationsToIssues.java:65) ~[classes/:na]
    at org.sonar.server.db.DatabaseMigrator.executeMigration(DatabaseMigrator.java:78) ~[classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_17]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_17]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_17]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_17]
[Cut some stacktrace info]
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) [jetty-server-7.6.11.v20130520.jar:7.6.11.v20130520]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668) [jetty-io-7.6.11.v20130520.jar:7.6.11.v20130520]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) [jetty-io-7.6.11.v20130520.jar:7.6.11.v20130520]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-util-7.6.11.v20130520.jar:7.6.11.v20130520]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-util-7.6.11.v20130520.jar:7.6.11.v20130520]
    at java.lang.Thread.run(Unknown Source) [na:1.7.0_17]
Caused by: java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerException: Unable to identify the table TRUNCATE TABLE issues for the metadata. Query: TRUNCATE TABLE issues Parameters: []
    at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:363) ~[commons-dbutils-1.5.jar:1.5]
    at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:490) ~[commons-dbutils-1.5.jar:1.5]
    at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:376) ~[commons-dbutils-1.5.jar:1.5]
    at org.sonar.server.db.migrations.ConvertViolationsToIssues.truncateIssueTables(ConvertViolationsToIssues.java:74) ~[classes/:na]
    at org.sonar.server.db.migrations.ConvertViolationsToIssues.execute(ConvertViolationsToIssues.java:62) ~[classes/:na]
    ... 537 common frames omitted
2013.08.21 12:04:09 ERROR o.s.s.ui.JRubyFacade  Fail to render: http://localhost:9000/setup/setup_database
An error has occurred, this and all later migrations canceled:

java.lang.IllegalStateException: Fail to execute database migration: org.sonar.server.db.migrations.ConvertViolationsToIssues
    org/sonar/server/db/DatabaseMigrator.java:83:in `executeMigration'

1 个答案:

答案 0 :(得分:1)

问题在于使用SqlServer JDBC驱动程序。从SqlServer驱动程序切换到推荐的jTSD驱动程序修复了该问题。

感谢声纳团队。