Restoring builtin profile does not work - sonarqube

I'm working with SonarQube 5.5. I'm trying to restore the factory configuration of the Java "Sonar way" profile in SonarQube (after playing a bit with the configuration, I'd like to reset my changes). I'm using the button in Quality Profile -> Restore base profile -> Java.
The GUI tells me it has been successfully restored, but when I look at which rules are enabled, I see only 88 rules. A fresh install from SonarQube gives me 254 activated rules (see the screenshot #1).
There is nothing in the logs which would indicate something went wrong.
PS: I was upgrading from SonarQube 5.4, following the official guide (run in standard db, install the plugins you need, then switch to the old db, run setup, wait, then enjoy).
Any idea?

Deleting the content of the ${sonarhome}/data/es, then restarting, and retrying the restore led to success. I guess my elastic search index got somehow corrupted.

Related

IntelliJ 2017.2 stuck on `Loading archetype list` for `New Project` > `Maven`

When choosing the Create New Project option after launching IntelliJ 2017.2, I get this endlessly spinning wheel on the Maven tag, saying “Loading archetype list…”.
Any way to get to a Maven archetype?
I just hit this on 2017.2.3 (just updated now) on Fedora 24 (oops time to upgrade)
The immediate solution was to change the Maven settings (File > Settings > Maven) to use my on-machine Oracle JDK 1.8.0_144 instead the default "internal JRE" 1.8.0_152. Btw, the importer uses JVM option -Xmx768m by default.
And we go on...
Wait
Loading the full list of Maven archetypes seems to be quite an exertion for IntelliJ. Surprising, as I don't recall any such long delays in NetBeans.
So wait, be patient. May take a couple minutes. Make tea, pat the dog. Wait for the fan on your computer to spin up and then quiet again.
Use more memory
I currently have VM options for importer set to -Xmx2048m as shown in the Answer by Tonhofer.
I do not know if this point was key, but my problem has gone away «knock-on-wood». So this might be helping.
FYI… I have a 16-gig MacBook Pro (Retina, 15-inch, Late 2013) running Sierra 10.12.6 with two Java implementations, Java 8 Update 144 from Oracle and Java 9 beta jdk-9+181 from OpenJDK.
Quit, update repositories
While I do not understand what all is going on, it seems like this has been a workaround for me.
Quit IntelliJ, then launch again.
In Preferences/Settings, go to Build, Execution, Deployment> Build Tools > Maven > Repositories. Click each of the listed repositories, and click the Update button. A spinning wheel appears for the duration of the update.
A copy of each repository’s data is being downloaded and parsed on your local machine, descriptions of all the libraries known by that repository. Some of the repositories may be quite large with many listed projects. So this process may take a while, possibly more than several minutes.
When the updates are complete, try the New Project feature again.
Add more memory
Settings > Maven > Importing
VM options for importer -Xm1024m (or more)
Closing out of IntelliJ and creating the project from this window helped:
IntelliJ Welcome Screen
I managed to solve the issue by updating the NVIDIA driver, based on IntelliJ logs. Anything else did not work for me. The list loads now in a few seconds..finally.
Edit:
as Basil suggested, here are some clarifications. I am on Windows 10 Home Edition 64b, and I have IntelliJ 2017.2 with Java 1.8.0_152. I checked IntelliJ logs and followed a standard procedure: I went on Google and I searched by that exception (I can't remember what and where) and found a site where someone suggested to update my nVidia drivers. For the update, you only need to go to nVidia site and from that on it should be easy. I was on a 2016 driver and got to 2018 version after the update. I also have the previously added configurations from other comments.

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.

Sonar preview mode all new issues

I am trying to run SonarQube using Sonar runner in local dev box for pre-commit check. We have a central SonarQube server where a analysis is done every day and published to the dashboard. When we are running on local dev box everytime the the issue report contains all the issues as new hence incremental data is not available. I have also tried both incremental and preview mode but the result is some.
Please find below the version of the tools used.And also configuration files. Please let me know if some other data is required.
SonarQube version : 5.1
Sonar Runner version : 2.4
sonar-runner.properties
sonar.host.url=http://[central sonar server]:9000/
sonar.issuesReport.html.enable=true
sonar.login=admin
sonar.password=admin
sonar-project.properties
sonar.projectKey=myProj:myProj-master
sonar.projectName=MASTER_PROJECT
sonar.projectVersion=21.0
sonar.sources=./src
sonar.binaries=./bin/
sonar.issuesReport.html.enable=true
sonar.exclusions=com/**/test/*.java
sonar.skipPackageDesign=true
sonar.profile=SonarWay
sonar.preview.excludePlugins=devcockpit,buildstability,pdfreport,report,buildbreaker,views,jira,issueassign,scmstats
Command Used :
c:\sonar-runner-dist-2.4\sonar-runner-2.4\bin\sonar-runner -e -Dsonar.analysis.mode=preview -Dsonar.issuesReport.console.enable=true -Dsonar.issuesReport.html.enable=true
Updated with additional properties tried as well. in sonar-runner.properties
I believe your problem is tied directly to your use of a local server.
The purpose of preview analysis is to allow you to compare your local changes with what's on the remote SonarQube server. Since your remote server is update every night, running your preview against it will show you the issues you've introduced that day. Instead, you're running against a local instance which gets updated with a full analysis... never? Which (if true) would be why all your issues show up as new.
To execute a preview analysis against your remote server, you will need both the global Execute Preview Analysis permission and the project-level Browse permission for the project in question.
If for some reason you're unable to get those permissions (which is possibly why you're running a local SonarQube server?) Then you'll want to do the same full checkout and analysis locally every night that's being done for the official, remote server. I.e. you'll probably have to set up a second, parallel architecture. In short, it's probably easier in the long run to nag to get the appropriate permissions on the remote server.
Issue is resolved . 2 things fixed the issue.
Creating a user with the required permissions.
Installing "Issues Report" plugin

SonarQube Quality Profiles leads to "We're sorry, but something went wrong."

I've downloaded a SonarQube 4.2 and analyzed a project locally. After that, everytime I clicked "Quality Profiles" I got "We're sorry, but something went wrong.", even though the settings on the project itself show three profiles to be present already. Because I always pick the version with the bugs when downloading, I tried the same thing with a fresh SonarQube 4.2, 4.1.2, 4.0 and Sonar 3.7.4. Out of the box all of them presented the same page, so I guess this meaningless error message is by default. I already searched the doc and Google but couldn't find anyone explaining what I need to do to get the profiles to show correctly. So what did I miss?
You should probably change your java version. Sonar 3.4.7 (which is the latest stable version) runs correctly with java 7.
Yes, You have install jre o jdk 7 and edit wrapper.conf inside conf dir:
#********************************************************************
# Wrapper Java Properties
#********************************************************************
# JVM
wrapper.java.command=C:\Program Files\Java\jdk1.7.0_65\bin\java

Sonar Issue - Version update

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.

Resources