We are planning to upgrade to 9.9LTS and are in the process of verifying the upgrade.
After the upgrade, I am getting the following error message and am unable to start SonarQube.
Please let me know if there is any solution to this problem.
The error message is as follows
[sonar@sonarqube-developer ~]$ /opt/sonarqube/bin/linux-x86-64/sonar.sh start
/usr/bin/java
Starting SonarQube…
Started SonarQube.
[sonar@sonarqube-developer ~]$ /opt/sonarqube/bin/linux-x86-64/sonar.sh status
/usr/bin/java
Removed stale pid file: ./SonarQube.pid
SonarQube is not running.
[sonar@sonarqube-developer ~]$ cd /opt/sonarqube/logs
[sonar@sonarqube-developer 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
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 installed Java 17 using the alternative install command.
[starsshd@sonarqube-developer bin]$ java -version
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, sharing)
I then ran SonarQube and checked the status with the status command, but it did not seem to start properly.
[sonar@sonarqube-developer ~]$ /opt/sonarqube/bin/linux-x86-64/sonar.sh start
/usr/bin/java
Starting SonarQube...
Started SonarQube.
[sonar@sonarqube-developer ~]$ /opt/sonarqube/bin/linux-x86-64/sonar.sh status
/usr/bin/java
Removed stale pid file: ./SonarQube.pid
SonarQube is not running.
I checked the log file and found the following status.
[sonar@sonarqube-developer ~]$ cd /opt/sonarqube/logs
[sonar@sonarqube-developer logs]$ cat nohup.log
2023.05.29 11:16:46 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube-9.9.0.65466/temp
2023.05.29 11:16:46 ERROR app[][o.s.application.App] Startup failure
java.lang.IllegalArgumentException: Unable to create shared memory :
at org.sonar.process.sharedmemoryfile.AllProcessesCommands.<init>(AllProcessesCommands.java:103)
at org.sonar.application.AppFileSystem.reset(AppFileSystem.java:63)
at org.sonar.application.App.start(App.java:53)
at org.sonar.application.App.main(App.java:81)
Caused by: java.io.FileNotFoundException: /opt/sonarqube-9.9.0.65466/temp/sharedmemory (Permission denied)
at java.base/java.io.RandomAccessFile.open0(Native Method)
at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:344)
at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:259)
at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:213)
at org.sonar.process.sharedmemoryfile.AllProcessesCommands.<init>(AllProcessesCommands.java:100)
... 3 common frames omitted
Is there anything else that may be preventing SonarQube from running?
The first thing I would do is check permissions on the file system for the user running your SonarQube instance. Are they the owner (chown) of all the files in the SonarQube installation directory?