Sonarqube could not start sucessfully

Hi everyone, i meet some problems when starting sonarqube process.

Here is the sonarqube.service file below:
[Unit]
Description=SonarQube service
After=syslog.target network.target

[Service]
Type=simple
User=sonarqube
Group=sonarqube
PermissionsStartOnly=true
ExecStart=/bin/nohup /opt/java/bin/java -Xms32m -Xmx32m -Djava.net.preferIPv4Stack=true -jar /opt/sonarqube/lib/sonar-application-10.6.0.92116.jar
StandardOutput=journal
LimitNOFILE=131072
LimitNPROC=8192
TimeoutStartSec=5
Restart=always
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

And this is the status of sonarqube(the port of sonarqube is 4950):
sudo systemctl status sonarqube.service
× sonarqube.service - SonarQube service
Loaded: loaded (/etc/systemd/system/sonarqube.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2024-07-18 12:43:37 CEST; 11s ago
Process: 5936 ExecStart=/bin/nohup /opt/java/bin/java -Xms32m -Xmx32m -Djava.net.preferIPv4Stack=true -jar /op>
Main PID: 5936 (code=exited, status=127)
CPU: 3ms

Jul 18 12:43:37 ubuntu-vm systemd[1]: sonarqube.service: Scheduled restart job, restart counter is at 5.
Jul 18 12:43:37 ubuntu-vm systemd[1]: Stopped SonarQube service.
Jul 18 12:43:37 ubuntu-vm systemd[1]: sonarqube.service: Start request repeated too quickly.
Jul 18 12:43:37 ubuntu-vm systemd[1]: sonarqube.service: Failed with result ‘exit-code’.
Jul 18 12:43:37 ubuntu-vm systemd[1]: Failed to start SonarQube service.

I’d like to know if there’s something wrong and how could i fix this problem.

Thank you so much for your reply.

Hey there.

What do the logs say?

Thank you for your reply.

Inside the nohup.log file displays the following error:

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

Hey there.

Java 17 is required to run the server. If you need to have multiple versions of Java installed on your server, you can adjust the SONAR_JAVA_PATH environment variable to point to the correct one for SonarQube to use at startup.

Your error message indicates that SonarQube is only finding Java 11.

Thank you for your reply, Colin.

We solved the problem, the sonarqube.service is active. But we still couldn’t launch sonarqube, whatever we use http or https connection (of course plus port number).

Here’re some configuration files.

In the “/etc/sysctl.conf” file we added these lines:
m.max_map_count=262144
fs.file-max=65536
ulimit -n 65536
ulimit -u 4096

In the “/etc/systemd/system/sonarqube.service” file we added:
[Unit]
Description=SonarQube service
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start
ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop
User=sonar
Group=sonar
Restart=always
LimitNOFILE=65536
LimitNPROC=4096
[Install]
WantedBy=multi-user.target

Do you know what happened? Thanks again.

Once again, what do the logs say?

Hallo, here is the photo of the log file.

What about the web.log file?

Also, your log file is now showing that you’re using SonarQube v9.6 instead of v10.6. Which is it?

Hello Colin,

actually i installed Java 17 and Sonarqube 10.6, but i don’t know why in the logs displays java 11 and sonarqube 9.6.

Here is the Web.log file.

Thanks again.

If you’re starting SonarQube from the service, maybe /opt/sonarqube is pointing to another installation on the same machine, rather than your new SonarQube 10.6 install?

Is this server precious? Something tells me you’ll have a lot better luck just starting from scratch.

:joy:Thank you so much. I install sonarqube on a new vm, now i could see the interface.