Upgrade to SonarQube 7.7 / 7.9

  • versions used

    • Source version : 7.6 Enterprise

    • Target version : 7.7 Enterprise (also tried with 7.9.1 enterprise) Java 11

  • error observed


2019.07.17 07:53:33 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001

2019.07.17 07:53:33 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch

2019.07.17 07:53:34 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

_Unrecognized VM option 'UseParNewGC'_

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

2019.07.17 07:53:34 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1

2019.07.17 07:53:34 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped

2019.07.17 07:53:34 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped

  • steps to reproduce

    • Install Java 11 on sonar server

    • Upgrade the sonar instance with Java 11 and then ry the upgrade

  • Potential workaround : NONE

v7.7 technically doesn’t support Java 11 :slight_smile:

What’s in your conf/sonar.properties file related to JVM settings? Specifically sonar.search.javaOpts.

Colin

Aah, thanks for the hint. I removed the arguments from java.search.opts and now the error is gone.

But a new error has cropped up:
While trying to bring up the server on OpenShift cluster (with the docker Images created ourselves), we get the below error:

max virtual memory areas ***vm.max_map_count [65530]*** is too low, increase to at least [262144]

Now I understand the this has to be fixed on the Docker hosts, but we would like to avoid that. Incidentally, we also have an elasticsearch infrastructure in our organisation.

So my concerns would be:

  1. Do we need to stick to the internal implementation of ES? is it possible to leverage an external ES implementation?
  2. If that is not possible, can we have another solution which does not involve changing system configurations on OpenShift cluster?

Internal implementation only.

Elasticsearch won’t start without this check being passed, but unfortunately, we aren’t Docker experts here (yet) and currently don’t recommend using Docker to run SonarQube outside of demonstration purposes. Sorry I can’t be more help on this point :confused: Maybe somebody else has a better idea. Elasticsearch seems to have some docs.

Colin

All problems ironed out and instance is up an running now. All that is pending is migrating the DB from MySQL to MSSQL, and I face an issue here:

Current setup:
SQ: 7.7
DB : MySQL

Desired Setup:
SQ: 7.9 (or 7.9.1)
DB: MS-SQL

What I did:
I started the Desired Setup SQ instance and initiated the DB on MSSQL.
now while migrating the DB from Current Setup to Desired setup I face a problem
Problem faced:
I get the below error

c:\>mysql-migrator.bat -source ..\DB-Migration-source.txt -target ..\DB-Migration-Target.txt

Versions in source and target database don't match: 2612 != 2804

Did I miss an upgrade path?

Using the mysql-migrator, you need to first migrate your source database to a target database that uses the same schema (was created when started against the same SonarQube version as your source database), and after you migrate the database you can upgrade to v7.9

From the ReadMe

Start then stop your SonarQube version on your non-MySQL database (for example, if you’re currently using SonarQube 7.3, run then stop SonarQube 7.3 on your non-MySQL database).

Hi Colin.
I have been able to migrate couple of sonar instances to the new database. Thanks for the support.

I face the below issue in one particular Sonar instance DB Migration. Please suggest how I can resolve this.

bin/mysql-migrator -source DB-Migration-source-sonarProd.txt -target DB-Migration-Target-sonarProd.txt
Picked up _JAVA_OPTIONS: -Xmx2G -XX:+UseSerialGC
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table organizations ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table organization_members ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table groups_users ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table rules_parameters ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table rules_profiles ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table org_qprofiles ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table default_qprofiles ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table project_qprofiles ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table qprofile_edit_users ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table qprofile_edit_groups ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table groups ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table snapshots ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table group_roles ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table rule_repositories ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table rules ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table rules_metadata ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table events ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table quality_gates ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table quality_gate_conditions ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table properties ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table project_links ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table duplications_index ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table project_measures ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table internal_properties ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table projects ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table manual_measures ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table active_rules ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table notifications ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table user_roles ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table active_rule_parameters ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table users ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table metrics ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table loaded_templates ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table issues ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table issue_changes ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table permission_templates ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table perm_tpl_characteristics ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table perm_templates_users ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table perm_templates_groups ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table qprofile_changes ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table file_sources ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table ce_queue ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table ce_activity ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table ce_task_characteristics ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table ce_task_input ...
[main] INFO org.sonarsource.sqdbmigrator.migrator.ContentCopier - copying table ce_scanner_context ...
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at com.mysql.jdbc.Buffer.getBytes(Buffer.java:199)
        at com.mysql.jdbc.Buffer.readLenByteArray(Buffer.java:330)
        at com.mysql.jdbc.BufferRow.getColumnValue(BufferRow.java:315)
        at com.mysql.jdbc.ResultSetImpl.getBytes(ResultSetImpl.java:1766)
        at com.mysql.jdbc.ResultSetImpl.getBytes(ResultSetImpl.java:1745)
        at org.sonarsource.sqdbmigrator.migrator.ContentCopier.copyColumns(ContentCopier.java:121)
        at org.sonarsource.sqdbmigrator.migrator.ContentCopier.copyTable(ContentCopier.java:90)
        at org.sonarsource.sqdbmigrator.migrator.ContentCopier.lambda$execute$0(ContentCopier.java:60)
        at org.sonarsource.sqdbmigrator.migrator.ContentCopier$$Lambda$17/230528013.accept(Unknown Source)
        at java.util.Arrays$ArrayList.forEach(Arrays.java:3880)
        at org.sonarsource.sqdbmigrator.migrator.ContentCopier.execute(ContentCopier.java:46)
        at org.sonarsource.sqdbmigrator.migrator.Migrator.execute(Migrator.java:55)
        at org.sonarsource.sqdbmigrator.cli.MySQLMigrator.lambda$new$0(MySQLMigrator.java:68)
        at org.sonarsource.sqdbmigrator.cli.MySQLMigrator$$Lambda$1/1283928880.execute(Unknown Source)
        at org.sonarsource.sqdbmigrator.cli.MySQLMigrator.run(MySQLMigrator.java:106)
        at org.sonarsource.sqdbmigrator.cli.MySQLMigrator.main(MySQLMigrator.java:78)

Hey Amit , How did you overcome the virtual memry error. I’m struck at the same issue. I tried to disable it and run the sonar container but it is leading to the error when I perform the analysis.

removing the UseParNewGC options solved this for me.
what error you are getting while analysis?