0

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

消息说:

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

声纳正在运行:

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

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'

4

1 回答 1

1

问题在于使用 SqlServer JDBC 驱动程序。从 SqlServer 驱动程序切换到建议的 jTSD 驱动程序解决了这个问题。

感谢声纳团队。

于 2013-08-22T14:18:05.670 回答