【问题标题】:Sonar throwing error BadDatabaseVersion声纳抛出错误 BadDatabaseVersion
【发布时间】:2013-10-22 13:56:33
【问题描述】:

我已经在服务器 A 和服务器 B 上安装了声纳和 mysql 数据库。我正在尝试使用 sonar-runner 运行声纳分析,但每次我收到以下错误:

Caused by: java.lang.RuntimeException: wrapper
    at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:130)
    ... 22 more
Caused by: org.sonar.core.persistence.BadDatabaseVersion: The current batch process and the configured remote server do not share the same DB configuration.
    - Batch side: jdbc:mysql://xx.xx.xx.xx:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true (sonar / *****)
    - Server side: check the configuration at http://xx.xx.xx.xx:9000/system

服务器 B 正在从服务器 A 访问数据库。我已经检查了批处理和服务器端的所有配置,一切似乎都正常。

我也用谷歌搜索并找到了following link, 但我不明白如何解决这个问题。

任何指针?

【问题讨论】:

    标签: sonarqube


    【解决方案1】:

    如果您有 2 个 Sonar 实例指向同一个数据库,也会发生此错误。每个数据库只能有一个 Sonar 实例。

    Sonar 每次启动时都会更新prop_key = 'sonar.core.id' 表中prop_key = 'sonar.core.id' 中的一行,然后在执行分析时将缓存值与数据库中的值进行比较。如果两者不匹配,则会出现错误。

    要修复它,请关闭两个实例,然后仅重新启动您要保留的实例。 Sonar 将重置 sonar.core.id 的值,然后一切都会恢复正常。

    您可以通过 REST 获取服务器的缓存 id: http://server:port/sonar/api/server

    它必须与数据库中的那个相匹配,Sonar 才能工作。 select * from properties where prop_key = 'sonar.core.id'

    【讨论】:

    【解决方案2】:

    您确定 Sonar 服务器使用的数据库设置:

    匹配您的构建使用的数据库凭据?

    错误消息表明他们没有。 JIRA 问题SONAR-3685 已通过“不是错误”解决代码关闭。

    【讨论】:

    • 你好,一切似乎都很好!!!我真的很困惑该怎么办???请问有人能帮我吗
    • 检查“系统信息”屏幕。您确定 Database URL、Login、Driver 和 Driver Class 字段与您的 Sonar runner 的设置相匹配?如果是这种情况,请捕获 Sonar 屏幕的屏幕截图并附上 Sonar runner 属性文件的副本,然后重新打开 JIRA 问题。抱歉,如果没有更多信息,这个问题似乎是配置错误。
    猜你喜欢
    • 1970-01-01
    • 2018-10-04
    • 1970-01-01
    • 1970-01-01
    • 2016-06-15
    • 1970-01-01
    • 2017-11-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多