Not able to upgrade Sonarqube from 8.9.7 LTS to 9.9 LTS

Make sure to tell us:

  • What version are you upgrading from? - 8.9.7 LTS Developer Version
  • System information (Operating system, Java version, Database provider/version)
    – We are using Centos OS, Jdk 18 and postgre DB
  • What’s the issue you’re facing?
  • I have downloaded the war file and unzipped it and replaced the sonar.properties with old version. While running the systemctl start sonarqube , I was getting this error: failed to load the sonarqube.

What I noticed is this new version of sonarqube does not consists of wrapper.conf

What do the logs say?

‘’’
[root@tsd-sonarqube-dev-vm conf]# systemctl status sonarqube
● sonarqube.service - SonarQube service
Loaded: loaded (/etc/systemd/system/sonarqube.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Tue 2023-02-21 00:21:37 UTC; 5min ago
Main PID: 2232223 (code=exited, status=0/SUCCESS)

Feb 13 21:48:07 tsd-sonarqube-dev-vm systemd[1]: Starting SonarQube service…
Feb 13 21:48:07 tsd-sonarqube-dev-vm sonar.sh[2232171]: Starting SonarQube…
Feb 13 21:48:07 tsd-sonarqube-dev-vm sonar.sh[2232171]: Started SonarQube.
Feb 13 21:48:07 tsd-sonarqube-dev-vm systemd[1]: Started SonarQube service.
Feb 21 00:21:35 tsd-sonarqube-dev-vm systemd[1]: Stopping SonarQube service…
Feb 21 00:21:35 tsd-sonarqube-dev-vm sonar.sh[2258016]: Gracefully stopping SonarQube…
Feb 21 00:21:37 tsd-sonarqube-dev-vm sonar.sh[2258016]: Stopped SonarQube.
Feb 21 00:21:37 tsd-sonarqube-dev-vm systemd[1]: Stopped SonarQube service.
[root@tsd-sonarqube-dev-vm conf]# systemctl start sonarqube.service
[root@tsd-sonarqube-dev-vm conf]# systemctl status sonarqube
● sonarqube.service - SonarQube service
Loaded: loaded (/etc/systemd/system/sonarqube.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2023-02-21 00:27:26 UTC; 2s ago
Process: 2258417 ExecStart=/app/opt/sonarqube_dev_9.9/bin/linux-x86-64/sonar.sh start (code=exited, status=0/SUCCESS)
Main PID: 2258449 (code=exited, status=1/FAILURE)

Feb 21 00:27:25 tsd-sonarqube-dev-vm systemd[1]: sonarqube.service: Main process exited, code=exited, status=1/FAILURE
Feb 21 00:27:25 tsd-sonarqube-dev-vm systemd[1]: sonarqube.service: Failed with result ‘exit-code’.
Feb 21 00:27:26 tsd-sonarqube-dev-vm systemd[1]: sonarqube.service: Service RestartSec=100ms expired, scheduling restart.
Feb 21 00:27:26 tsd-sonarqube-dev-vm systemd[1]: sonarqube.service: Scheduled restart job, restart counter is at 5.
Feb 21 00:27:26 tsd-sonarqube-dev-vm systemd[1]: Stopped SonarQube service.
Feb 21 00:27:26 tsd-sonarqube-dev-vm systemd[1]: sonarqube.service: Start request repeated too quickly.
Feb 21 00:27:26 tsd-sonarqube-dev-vm systemd[1]: sonarqube.service: Failed with result ‘exit-code’.
Feb 21 00:27:26 tsd-sonarqube-dev-vm systemd[1]: Failed to start SonarQube service.
‘’’

These don’t look like the logs referenced by the link in my previous post.

[root@tsd-sonarqube-dev-vm logs]# ls -ltr
total 8
-rw-r–r-- 1 sonar sonar 88 Feb 3 11:19 README.txt
-rw-r–r-- 1 sonar sonar 317 Feb 21 00:27 nohup.log
[root@tsd-sonarqube-dev-vm logs]# cat nohup.log
Error: LinkageError occurred while loading main class org.sonar.application.App
** java.lang.UnsupportedClassVersionError: org/sonar/application/App has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0**

this is the java installed on the system
[root@tsd-sonarqube-dev-vm logs]# java --version
openjdk 11.0.7 2020-04-14 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.7+10-LTS, mixed mode, sharing)

As mentioned in the upgrade notes

SonarQube server requires Java 17
Java 17 is required for SonarQube server. Use of Java 11 is no longer supported. See the documentation on prerequisites for more information. (SONAR-17566)

I’m having same issue and I’m using OpenJdk 17
2023.02.24 07:34:43 INFO app[o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [C:\Program Files\Sonarqube9.9]: C:\Program Files\Microsoft\jdk-17.0.6.10-hotspot\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=C:\Program Files\Sonarqube9.9\temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx1G -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-9.9.0.65466.jar;C:\Program Files\Sonarqube9.9\lib\jdbc\mssql\mssql-jdbc-11.2.2.jre17.jar org.sonar.server.app.WebServer C:\Program Files\Sonarqube9.9\temp\sq-process12285243056599078994properties
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.sonar.process.PluginSecurityManager (file:/C:/Program%20Files/Sonarqube9.9/lib/sonar-application-9.9.0.65466.jar)
WARNING: Please consider reporting this to the maintainers of org.sonar.process.PluginSecurityManager
WARNING: System::setSecurityManager will be removed in a future release
2023.02.24 07:34:46 INFO app[o.s.a.SchedulerImpl] Process[Web Server] is stopped
2023.02.24 07:34:46 INFO app[o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.02.24 07:34:46 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped

We are planning to upgrade our Sonarqube v8.9.6 community edition to sonarqube 9.9.2 commnity edition. We are also using postgresql as db. Is there available and direct instruction on how to do the upgrade.