Sonarqube 5.0: Database schema must be updated - maven

Before I upgraded Sonar 5.0 I used the internal org.codehaus.sonar:sonar-maven-plugin:4.3.2. After the upgrade I used the same plugin in version 5.0 but got the error
Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:5.0:sonar (default-cli) on project at.biac.offer.pom: Please update sonar-maven-plugin to at least version 2.3
Then I switched to org.codehaus.mojo:sonar-maven-plugin:2.5 but now I get the following error
org.sonar.jpa.session.DatabaseException: Database schema must be updated [version/required=721/170]. Please browse to your sonar homepage.
Is there any way to fix this problem without loosing my analysis data so far?

Database upgrade is a normal step when doing an upgrade of the SonarQube server. You should not lose any data.

Related

How to upgrade sonar from 5.6 to 6.7 with dedicated database

I am using 5.6 version of sonar, want to upgrade to 6.7. Can I directly upgraded to 6.7 ?
I have 8-10 sonar projects hosted on a same instance of sonar server. I am not sure what would break after upgrade. I am thinking of following approach
Install (do not upgrade) a new version of sonar 6.7, this would run on the different port(s).
Create a copy of sonar database which I have with my older sonar version, attach that copy of DB to new installation of sonar (by updating the sonar configuration file).
Assuming everything works fine, retire the older version (sonar server & DB).
I am using dedicated database as SQL server.
Anybody tried this approach? does it work?
Atul
If you're using one of the supported databases, you can upgrade directly from 5.6 to 6.7.
Simply follow the Upgrade Guide - and make sure that you back up your DB first in case of troubles.

Sonarqube 5.2 with custom fxcop rules is not working

I upgraded sonarqube to 5.2. I replaced the old instance with a new instance, so the old configuration was deleted and replaced.
I have several custom fxcop rules.
When running the analysis, I am getting the following error.
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to find the rule key corresponding to the rule config key "HSI1009" in repository "fxcop".
This is caused by empty entries in the sonar created file fxcop-sonarqube.ruleset file.
Does anyone know if this is a bug or some error on my end? I did not have these sorts of issues before the 5.2 upgrade, but unable to go back due to reliance on some plugins using 5.2.
I was only able to fix this by downgrading back to SonarQube 5.1.2. Even though I am using the same C# plugin (5.0) and the same runner version (2.5), upgrading to SonarQube 5.2 and up broke custom fxcop rules.
This problem has been fixed with the SonarQube Scanner for MSBuild v1.0.2+ : https://jira.sonarsource.com/browse/SONARMSBRU-151
Also be sure to run the SQ Scanner for MSBuild in a .NET 4.5.2 context.

upgrade sonar and import all existing project matrix

we would like to upgrade from Sonar 3.0 to 3.5. we have many project profiles/matrix in the current sonar and if possible to import existing project matrix, build data and time machine data into the new sonar. How do i export current data and make them visible in Sonar 3.5?
Tried to upgrade in my testing machine and turned out Sonar page is empty. I followed all the Sonar upgrade guide including backup. It is important for us to keep existing project build and trending matrix(time machien).
btw, i'm using mysql.
When using Sonar with DBs like Oracle, MySql, Postgres or MSSQL, the migration process keeps everything already in place and you should end up with the same state as it was before the migration. If this is not the case, this means that the migration went wrong and you should be able to see it in the logs.

sonar-3.5.1 deploying project on sonar server but code not showing

I have upgraded my sonar version from sonar-3.2 to sonar-3.5.1 and upgraded sonar-runner from sonar-runner-1.1 to sonar-runner-2.2.2, now when i am deploying project on newly installed sonar 3.5.1 it run successfully and showing ANALYSIS SUCCESSFUL, it also show project name on sonar server when i use localhost:9000 on browser but code is not showing there, no violations are coming etc.
i am using sonar in two ways and both results the same. Two ways are:
1. using sonar standalone through sonar runner from cmd.
2. integrating sonar with Jenkins(1.515) and using maven(3.0.4)
when i do sonar analysis on sonar 3.2 everything is working fine in both of the above cases but problem comes only when i use sonar 3.5.1.
Can anybody help me out on this issue??
Please suggest what would be the possible way to overcome this issue..
your revert will be appreciable.. Thanks in advance!!
Please refer below for logs
and sonar dashboard
So I do confirm that the Sonar Java plugins have been deleted from the extensions/plugins directory and that's why you don't get any measures/violations when analysing a java project. Here is the link to download version 1.2 of the Sonar Java plugin ecosystem : http://docs.codehaus.org/download/attachments/230396085/JavaEcosystem-1.2.zip. You just have to decompress this archive, place all jar(s) in the extensions/plugins directory and relaunch the Sonar server.

Sonar in Maven build stopped working

I had a project built with maven on a Jenkins CI server, and recently the Sonar portion of the build began to fail with the well known
org.sonar.core.persistence.BadDatabaseVersion: Database must be upgraded. Please browse http://x.x.x.x:9000/setup
I browsed to http://x.x.x.x:9000/setup, and the message there was green and said my database was up to date. The database looks good and the sonar server doesn't throw any Exceptions as far as I can tell from the output, and this installation had been working well up until a few days ago.
I checked that the id was the same between the running server and the database, and insured that only one instance of Sonar was talking to the H2 DB.
My next step is to step through Sonar code, which I'm not eager to do. Any pointers as to what's wrong would be appreciated.
Thanks.
Your Maven plugin version is probably not aligned with your Sonar install.

Resources