Sonarqube doesn't start on Centos 8

  • versions used (SonarQube: 8.4)
  • error observed sonar.log:
    ‘’‘sudo tail -f /opt/sonarqube/logs/sonar.log 2020.09.14 10:41:55 INFO app[] Elasticsearch listening on /
    2020.09.14 10:41:55 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=‘es’, ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
    2020.09.14 10:41:55 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
    Java HotSpot™ 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
    2020.09.14 10:41:55 INFO app[o.e.p.PluginsService] no modules loaded
    2020.09.14 10:41:55 INFO app[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
    2020.09.14 10:41:57 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
    2020.09.14 10:41:57 INFO app[o.s.a.SchedulerImpl] Process[es] is stopped
    2020.09.14 10:41:57 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped’’’

‘’‘sudo tail -f /opt/sonarqube/logs/es.log
at org.elasticsearch.cli.Command.mainWithoutErrorHandling( ~[elasticsearch-cli-6.8.0.jar:6.8.0]
at org.elasticsearch.cli.Command.main( ~[elasticsearch-cli-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.main( ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.main( ~[elasticsearch-6.8.0.jar:6.8.0]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives( ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Bootstrap.setup( ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Bootstrap.init( ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.init( ~[elasticsearch-6.8.0.jar:6.8.0]’’’

Java version
‘’‘java version “11.0.8” 2020-07-14 LTS
Java™ SE Runtime Environment 18.9 (build 11.0.8+10-LTS)
Java HotSpot™ 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode)’’’

Postgresql version: 10

There is no ce.log or web.log file present, I haven’t been able to start the sonarqube, can anyone help me with this?

Helloi @shivamprakhar and welcome to the community :wave:

i think you already posted the answer to your question :slight_smile:

Hi Tobias,
(facepalm) I didn’t see it until I mentioned it here. Thanks for this. Now I am searching for how to fix that issue, would you have any reference by chance?

happens to the best of us :slight_smile:
sure. you have to create a new user and run sonarqube as this user. i would suggest to do this via systemd, where you can find more information about here

Although I have created a user account for sonarqube which has all the file permissions for the sonarqube direcotry, not sure if you are referring to add a new user named elasticsearch for this.

how do you try to start sonarqube? the file permissions are one thing but you will need to actually execute the start script as this user

I switch to user account sonarqube and then run the script:
$su - sonarqube
/opt/sonarqube/bin/linux-x86-64/ start
Starting SonarQube…
Started SonarQube.
and when I check the es.log I get the same error, I tried this way too, sorry that I didn’t make it clear in the first thread.

can you post the permissions of this user you created? also did you try to use the systemd service as documented?

Description=SonarQube service

ExecStart=/bin/nohup /usr/bin/java -Xms32m -Xmx32m -jar /opt/sonarqube/lib/sonar-application-8.4.jar


Thanks a ton Tobias, I ran it as a systemd service and it started running. Not sure where I messed up the permission that it didn’t run when I tried to run it as the sonarqube user.

glad that this is working for you now :+1:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.