Why the SonarQube server fails to start with following error message "Database relates to a more recent version" - sonarqube

I'm using Sonar 3.7.2 with JTDS driver for MSSQL database. While starting the sonar in windows gives following error:
2015.06.26 02:54:53 INFO o.s.s.p.ServerImpl SonarQube Server / 3.7.2 / 1feffde9f95897aa000a7123ba54a8c8757b40d8
2015.06.26 02:54:53 INFO o.s.c.p.Database Create JDBC datasource for jdbc:jtds:sqlserver://enbuild03/sonar;SelectMethod=Cursor
2015.06.26 02:54:54 **ERROR o.s.s.p.Platform Database relates to a more recent version of sonar. Please check your settings**.
org.sonar.api.utils.MessageException: Database relates to a more recent version of sonar. Please check your settings.
2015.06.26 02:54:57 INFO jruby.rack jruby 1.6.8 (ruby-1.8.7-p357) (2012-09-18 1772b40) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_43) [Windows Server 2008 R2-amd64-java]
2015.06.26 02:54:57 INFO jruby.rack using a shared (threadsafe!) runtime
I'm stuck here since sonar server not even starting because of the above bold error...
Any help will be appreciated ???

It somehow seems that a newer version of sonar has been run against the db you created. Can you try creating a new DB and see if that works?

If you have run some latest version of sonarqube and then downgraded the sonarqube; you are likely to get this error, if both versions are mapped to same database.
If you view the database there will be some tables in that db, once you wipe out the content of DB and restart sonarqube this error will be gone.

Related

SonarQube 4.5.7 to 5.6.5 DB Upgrade failure

I have attempted to upgrade our SonarQube instance from 4.5.7 LTS to 5.6.5 LTS. I followed the provided SonarQube upgrade documentation. After browsing to [sonarserver]:9000/setup and ran the DB Upgrade. The upgrade ran a little over 2 hours and came back with this message:
Upgrade Failed
Database connection cannot be established. Please check database status and JDBC settings.
When viewing the log, I see this error:
2017.02.16 13:18:43 ERROR web[o.s.s.d.m.DatabaseMigrator] Fail to execute database migration: org.sonar.db.version.v50.FeedFileSources
java.lang.IllegalStateException: Error during processing of row: [uuid=AVpHrbhU29-XDi5QdhtN,uuid=AVpHrbk629-XDi5Qdh0r,data=using System;
I have copied the entire db upgrade log here: http://pastebin.com/p9CkYhrU
I also tried to restart SonarQube and attempt the db upgrade again, but it ran for 5-10 mins and reported the same result.
Additional Details:
Current SonarQube: 4.5.7 LTS
New SonarQube: 5.6.5 LTS
DB: MySQL 5.7.17
Operating System: Windows Server 2012 R2
After the unsuccessful upgrade, we reverted back to 4.5.7 successfully.
We also previously upgraded from 4.3.1 to 4.5.7 LTS. During this upgrade, we moved our SonarQube database from MySQL 5.5 to 5.7.17 and then upgraded SonarQube to 4.5.7 LTS. The upgrade step for this ran two hours and completed successfully.
Thank you for any assistance,
-Eddie
UPDATE 2/21/17
I stood up a test instance for this SonarQube upgrade on a different server. I installed MySQL 5.7 and SonarQube 4.5.7 LTS using the same backup data. During the upgrade to SonarQube 5.6.5 LTS, I received the same error as before. So I knew at this point that I could duplicate the error. I decided to look at that error message again and found these a bit further down:
Caused by: java.sql.BatchUpdateException: Packet for query is too large (6371233 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.
Caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (6371233 > 4194304). You can change this value on the server by setting the `max_allowed_packet` variable.
So I went ahead and edited the max_allowed_packet variable in my.ini. First I changed it from 4M to 8M and received a similar error. Next, I changed the variable to 16M and the upgrade got past the error!
Unfortunately, the DB Upgrade ran for 11 more hours and came back with another error:
2017.02.21 02:48:13 ERROR web[o.s.s.d.m.DatabaseMigrator] Fail to execute database migration: org.sonar.db.version.v564.CleanUsurperRootComponents
java.lang.IllegalStateException: Error during processing of row: [id=62566,uuid=AVpc2I0gt4GsKrhSYYYQ]
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Application was streaming results when the connection failed. Consider raising value of 'net_write_timeout' on the server.
Caused by: java.net.SocketException: Connection reset
I increased the net_read_timeout in mysql from 60 to 1200. set net_write_timeout = 1200; I restarted SonarQube, ran the DB Upgrade again, and got past the error. The upgrade continued running and I received another error:
2017.02.21 09:57:05 ERROR web[o.s.s.d.m.PlatformDatabaseMigration] DB Migration or container restart failed. Process ended with an exception java.lang.IllegalStateException: Fail to load plugin Clirr [clirr]
Caused by: java.lang.NoClassDefFoundError: org/sonar/api/batch/maven/DependsUponMavenPlugin
Caused by: java.lang.ClassNotFoundException: org.sonar.api.batch.maven.DependsUponMavenPlugin
Looks like a plugin error, so I went ahead and looked into that individual plugin. I found some information about the Clirr plugin being deprecated, so I removed it from the Plugins folder, restarted SonarQube, and got hit with another plugin error (different plugin). I got 6 or 7 of these errors and was able to fix them by either removing or replacing the .jar in the Plugins folder with the newer compatible version.
So after fixing the Java plugin, I restarted SonarQube and it started up fine! I am now running SonarQube 5.6.5 LTS on my sandbox server. The next step will be for me to revert back to 4.5.7 LTS and try the upgrade again to be sure I will have a successful production upgrade in the future.

SonarQube :: Current version is too old. Please upgrade to Long Term Support version firstly

I downloaded sonarqube-5.6 and configured the sonar.properties . My mysql version is 5.6 and java version is 1.8. when I start sonar getting error current version is too old , while my sonar is 5.6. Here is error log and sonar.properties
2016.08.03 18:30:13 INFO web[o.s.s.p.ServerImpl] SonarQube Server / 5.6 / 074f3d1169f9688d15af4aff67e7e672cbeed782
2016.08.03 18:30:13 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
2016.08.03 18:30:13 ERROR web[o.a.c.c.C.[.[.[/sonar]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
org.sonar.api.utils.MessageException: Current version is too old. Please upgrade to Long Term Support version firstly.
Sonar.properties
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEn
coding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
Edit ::
Please note I am using 5.6 version which is latest as per http://docs.sonarqube.org
Link says "you must first upgrade to 4.5.x - I'd recommend 4.5.7 - and then upgrade to 5.3." . I am not getting this , should I install lower version fist and upgrade it 5.6 or what
Version 5.6 can't be upgraded from a version previous to 4.5.x. It seems to be your case, so you should first upgrade to 4.5.x (the latest 4.5.7 is recommended) then upgrade to 5.6.

Fuseki 2: Security issue "Information Exposure"

I'm working with Apache Fuseki 2.3.1. on Linux RedHat as a standalone server:
>> java -Xmx16384M -jar fuseki-server.jar --port=8080 --loc=/space/tdb /ds
The safety tests team has raised an anomaly of "Information Exposure" (CWE-200 - http://cwe.mitre.org/data/definitions/200.html), in particular the Fuseki and JETTY versions are showed.
For example, if I submit an incorrect query, it's shown:
Error 400: ...
Fuseki - version 2.3.1 ....
Does anyone know how to prevent this issue?
This issue was solved by Jena/Fuseki team and will be released on next version of Fuseki (2.4.0).
See:
Suppress output of "Server:" with version information.

import neo4j database from windows to ubuntu

I have created a neo4j database on my windows machine.
I have transferred the content of the database directory to my linux machine. This is because I have the community edition which does not support the backup functions.
mtt#mttPC:/var/lib/neo4j/data/log$ sudo service neo4j-service start
WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual.
WARNING! You are using an unsupported Java runtime.
* Please use Oracle(R) Java(TM) 7 to run Neo4j Server. Download "Java Platform (JDK) 7" from:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
* Please see http://docs.neo4j.org/ for Neo4j Server installation instructions.
Using additional JVM arguments: -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
Starting Neo4j Server...WARNING: not changing user
process [21498]... waiting for server to be ready..... Failed to start within 120 seconds.
Neo4j Server may have failed to start, please check the logs.
The file messages.log in the database directory says nothing.
Any idea? Are the windows and linux neo4js compatible? Thank you.
Edit
I have made a fresh install of neo4j on my ubuntu machine.
Now I finally get some logs:
2014-05-16 20:01:10.958+0000 ERROR [o.n.k.EmbeddedGraphDatabase]: Startup failed: Component 'org.neo4j.kernel.impl.transaction.XaDataSourceManager#25984c63' was successfully initialized, but failed to start. Please see attached cause exception.: Component 'org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource#3d34dcb' was successfully initialized, but failed to start. Please see attached cause exception.: 'neostore' has a store version number that we cannot upgrade from. Expected 'NeoStore v0.A.0' but file is version 'NeoStore v0.A.2'.
2014-05-16 20:01:10.958+0000 INFO [o.n.k.EmbeddedGraphDatabase]: Shutdown started
I should be related to this but I am not sure how to proceed. Is the issue related to the fact that when I copied the database, I just stopped neo4j on my windows machine from the neo4j window?
There is no reason why a Neo4j database should not be transferable between operating systems. Can you please provide the output of data/log/console.log? First thought is that you may have permission issues. The files should be read/write for the user the Neo4j process will run as.

Upgrade fails: Fail to execute database migration to Sonarqube 3.6.2

When I would to upgrade from Sonar 3.2 to Sonarqube 3.6.2. the upgrades fails
Int the log file I read the folowing line:
Fail to execute database migration: org.sonar.server.db.migrations.ConvertViolationsToIssues
I use a MSSQL database, I read that someone got exactly the same error when he wanted to upgrade using an Oracle 10g database. I read that this problem will be solved in 3.7. Is this also applying to my problem? When 3.7 will be realeased?
With kind regards.
Your issue indeed looks like 2 other ones listed on stackoverflow:
Sonar-Upgrade from 3.5.1 to 3.6.2 failed
upgrade from sonarqube 3.5.1 to 3.6.2 fails on migration of postgres db
(would need more log to be sure, but I'm almost 100% sure)
So indeed, it will be fixed with SONAR-4542 that will be shipped with SonarQube 3.7, expected in a couple of days from now (around August 9th).

Resources