Sonar Issue - Version update - sonarqube

Sonar is an open platform to manage code quality. I have the admin access to perform the updates. Recently I tried performing a version update from 3.7.3 to 4.1.1.Unfortunately 4.1.1 is only compatible with IE9 or above. Hence I back out the changes as in our organization IE8 is the internet browser. Now 3.7.3 is not working as it is showing as database is pointing to a latest version.MySQL is used to hold the sonar data. I am completely stuck with the issue. Sonar is a very important tool for us as this can only take a code coverage metrics for the source code.
May I request you to look in to this issue and provide some help. I cannot move forward without your help.
Anticipating your help and support.

The only way to get back to a normal state is to start over from a 3.7.3 database backup.

Related

Any newer version of sonar-bitbucket-plugin for sonarqube-7.5?

My organization is using sonarqube:7.1 with sonar-bitbucket-plugin-1.2.3 (https://github.com/mibexsoftware/sonar-bitbucket-plugin) and everything is working fine. We are planning to upgrade to sonarqube:7.5 and while I was testing all the existing plugins, sonar-bitbucket-plugin is causing the issue(It's not supported in the newer version of Sonarqube). I want to upgrade to 7.5+ version of Sonarqube and want sonar-bitbucket-plugin as well. Could someone please help me out?
ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
java.lang.IllegalStateException: Fail to load plugin Bitbucket for Sonar [sonarbitbucket]
This community plugin was relying on the deprecated preview/issues analysis mode to analyze pull requests, that was finally removed.
Since SonarQube 6.7 the support of branches (and then pull requests) analysis has been properly integrated on the server side. Decorating PR was added progressively for various ALM, and for Bitbucket Server it is supported since 7.7.
Note that all branch/PR features are only available in commercial editions (or for free on SonarCloud for open source projects).

Make Sonarqube 6.7.5 Community version comment on pull requests

I'm trying to update Sonarqube usage to the latest LTS Community version, which at present is version 6.7.5. Prior to the upgrade I have been using sonarqube 5.4 and the Github plugin, and with these when we make Github pull requests the Sonarqube analysis runs in "preview" scan mode and makes comments on the pull request for any issues the scan finds. This setup is largely following this pattern.
However, with the upgrade to 6.7.5 this same flow is no longer working. The Github plugin
"is deprecated, and its functionality more than replaced by the
Developer Edition."
I understand that the Developer version of Sonarqube has pull request commenting built-in, but I have a strong preference to continue using the Community version due to the cost differences. Essentially, something that was once free and part of the open source version seems to have been removed or broken in the latest free and open source version because a similar paid option now exists. So I am trying to find a way to preserve the previous Community version usage with the latest Community Sonarqube version. 6.7.5 Community version runs the Github plugin (even though it the plugin is deprecated), but so far I have been unable to get things to make comments on the Github pull requests.
Is there a combination of parameters/plugins that will allow my 6.7.5 Community version of Sonarqube to analyze and make comments on a Github pull request?
These may be relevant:
https://community.sonarsource.com/t/after-upgrade-to-sq-6-7-5-target-sonar-issues-report-issues-report-light-html-is-not-produced/1921
https://jira.sonarsource.com/browse/SONAR-9770
https://community.sonarsource.com/t/preview-mode-ignored/1234
I believe in my case the issue was that after upgrading the rule sets changed, so the rules I initially thought were being used with 6.7.5 were not in fact being applied. This gave the impression that Sonarqube was not commenting on the pull request and led to my question. But after enabling the rules appropriately I was able to see it comment on GitHub pull requests as expected. So this appears to be a case of user error!

Rules ignored when restore quality profile in SonarQube

I saw many posts with this question, but I didn't find the answer so I ask. I upgraded Sonarqube from 4.5 to 5.6 and it works fine, but the quality profiles are empty. I tried to restore one with the backup/restore option but the rules are ignored:
image. Can you help me?
It sounds like you started up your new instance without the code analyzers.
Unfortunately, installing the analyzers now won't restore your profile customizations. You allude to having backup profile files, so you may be able to get them back that way, but you should be aware that you'll lose some rule customizations.
Assuming you backed up your database before the upgrade like the docs tell you to, your best bet is to restore your DB backup to the pre-upgrade state, install the missing code analyzers, then run the database upgrade.
I also faced the same issue with SonarQube 6.4. I was trying to Reload findbugs rules whereas the plugin was not installed. I first installed the plugin for findbug from Admin login - Update screen. After this if we use Create - Reload Profiles option, it works fine.

sonarqube incremental analysis is not working for team configuration

I've configured sonarqube server on my local machine to run and I committed the initial project with Analysis mode. Also, I created an ant target for the developers to run in incremental mode to view their new issues. I installed issuesReport on sonar server and using it from the ant file to generate html files.
However, when each developer syncs with svn and runs the ant target, they see violations by other developers under the new issues instead of only their issues.
I expected the sonarqube plugin only scan newly edited file by the developer, but is instead showing all the new files that are introduced by other developers.
To make it work properly I have to run an analysis mode from my machine. However this fixes the problem only for me, my colleagues still see all the violations as new.
How does SonarQube decide if an issue is new or not? If each developer has to run a full analysis every time, this would be big over head. Is there something am I missing?
Thanks in advance for your time and help.
An issue is considered "new" if it does not exist on the analysis server. If you run a full analysis on a CI server on a scheduled basis, it will feed the server with issues and reduce the risk of developers seeing other developer's issues in issues report in preview mode.
Please note, that the sonar documentation says, incremental mode is only for the developers and that too for the code they run against sonar prior to scm (SVN or GIT) commit.
See incremental section on the page: http://www.sonarqube.org/analysis-vs-preview-vs-incremental-preview-in-sonarqube/
The sonar report, when run with incremental mode, will show the developer, how much issue will be generated, if he commits the code. This way developer gets to know, what he can do to keep the sonar issues low. This is the whole purpose of incremental mode.
Hope this answers your question!!!

Upgrate to Sonarqube 3.6 takes over 2 hours! Is it correct?

I'm just upgrading our Sonar installation, from v3.5.1 to 3.6, and the process has been running for over two hours. Last log file entry was "Convert 508818 violations to issues" as the process was starting.
Now, the sonar site /setup is still showing "Sonar database is currently upgrading".
Is it correct that the upgrade of 500.000 violations to issues takes so much time?
Why does the log file is not being updated?
Thanks in advance.
Andreas
The upgrade from 3.5.1 to 3.6 can indeed last very long - but it will complete. You're facing this limitation: https://jira.codehaus.org/browse/SONAR-4470
This is mainly linked to performance issues on JRuby side (DB migration scripts are usually written on Rails side). As you can read in the ticket, we decided to rewrite this migration script in full Java and to provide a SonarQube 3.6.1 fix version.

Resources