SonarQube rules getting disabled on startup

2019-06-25 11:06发布

I initially setup a Sonar server on my development machine but later created a server on the official Linux machine, with the intent to stop using the dev one. During this transition i may have had both servers run at the same time (pointing to the same Sonar database).

Now i am seeing some strange behavior. The local server comes up fine and i am able to run Sonar builds on it. However when i start the Linux server, it fails to load any rules, i see the following in the startup logs, and the rules page says 'no coding rules.'

2015.06.18 09:32:10 INFO  web[o.s.s.r.RegisterRules] Disable rule squid:S1181
2015.06.18 09:32:10 INFO  web[o.s.s.r.RegisterRules] Disable rule squid:S1151
2015.06.18 09:32:10 INFO  web[o.s.s.r.RegisterRules] Disable rule squid:S1150
2015.06.18 09:32:10 INFO  web[o.s.s.r.RegisterRules] Disable rule squid:S1153
2015.06.18 09:32:10 INFO  web[o.s.s.r.RegisterRules] Disable rule squid:S1148
2015.06.18 09:32:10 INFO  web[o.s.s.r.RegisterRules] Disable rule squid:S2236
2015.06.18 09:32:10 INFO  web[o.s.s.r.RegisterRules] Disable rule squid:S1147
2015.06.18 09:32:10 INFO  web[o.s.s.r.RegisterRules] Disable rule squid:S1149
2015.06.18 09:32:10 INFO  web[o.s.s.r.RegisterRules] Disable rule squid:S2232
2015.06.18 09:32:10 INFO  web[o.s.s.r.RegisterRules] Disable rule squid:S1143
2015.06.18 09:32:10 INFO  web[o.s.s.r.RegisterRules] Disable rule squid:S2235
2015.06.18 09:32:10 INFO  web[o.s.s.r.RegisterRules] Disable rule squid:S1145
2015.06.18 09:32:10 INFO  web[o.s.s.r.RegisterRules] Disable rule squid:ClassCyclomaticComplexity

When i looked into the rules table, i noticed that all rules have the status 'REMOVED.' Now when i stopped the Linux server and brought up the other one, the table suddenly had 270 odd rules with the status of 'READY'.

So looks like when the Linux server starts up, it deactivates any available rules, but the other server is able to get them in this table again.

I can't find any documentation about this behavior but seems to be a conflict between the two servers. Can anybody help me get the rules activated for the Linux server?

标签: sonarqube
1条回答
仙女界的扛把子
2楼-- · 2019-06-25 11:48

It's most likely that you don't have the same set of plugins between the 2 instances. Please check the contents of the $SQ_HOME/extensions/plugins directory on both servers, if they are not the same you will have to install missing plugins using the Update Center.

Also note that sharing the same database with two server instances is not supported and can lead to extremely strange behavior.

查看更多
登录 后发表回答