声纳抛出错误 BadDatabaseVersion [英] Sonar throwing error BadDatabaseVersion

查看:29
本文介绍了声纳抛出错误 BadDatabaseVersion的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have installed sonar and mysql database on server A and on server B. I'm trying to run sonar analysis using sonar-runner but every time I get the following error:

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 访问数据库.我已经检查了批处理和服务器端的所有配置,一切似乎都正常.

Server B is accessing DB from server A. I have checked all configurations from batch and server side everything seems to be ok.

我也用谷歌搜索并找到了 以下链接,但我不明白如何解决这个问题.

I also googled and found the following link, but I cannot understand what to do for resolving this issue.

任何指针?

推荐答案

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

This error can also happen if you have 2 Sonar instances pointing at the same database. You can only have one Sonar instance per database.

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

Sonar updates a row in the properties table where prop_key = 'sonar.core.id' every time it starts up, and then compares the cached value against the one in the database whenever an analysis is executed. If the two don't match then you get the error.

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

To fix it, shut down both instances then only restart the instance you want to keep. Sonar will reset the sonar.core.id value and things should work again.

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

You can get the server's cached id via REST: http://server:port/sonar/api/server

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

It has to match the one in the database for Sonar to work. select * from properties where prop_key = 'sonar.core.id'

这篇关于声纳抛出错误 BadDatabaseVersion的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆