Unable to install SonarQube v7.8

Hi,

I am installing SonarQube 7.8 on my Linux machine. I have downloaded the file ‘sonarqube-enterprise-7.8.zip’ , unzipped it on Linux machine and tried running sonar.sh console. I am getting below error :
Running SonarQube…
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM…
jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
jvm 1 |
jvm 1 | 2019.06.26 02:44:35 WARN app[o.s.application.App] SonarQube will require Java 11+ starting on next version
jvm 1 | 2019.06.26 02:44:35 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/Sonarqube/sonarqube-7.8/temp
jvm 1 | 2019.06.26 02:44:35 INFO app[o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
jvm 1 | 2019.06.26 02:44:35 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=‘es’, ipcIndex=1, logFilenamePrefix=es]] from [/opt/Sonarqube/sonarqube-7.8/elasticsearch]: /opt/Sonarqube/sonarqube-7.8/elasticsearch/bin/elasticsearch
jvm 1 | 2019.06.26 02:44:35 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1 | 2019.06.26 02:44:36 INFO app[o.e.p.PluginsService] no modules loaded
jvm 1 | 2019.06.26 02:44:36 INFO app[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1 | 2019.06.26 02:44:47 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
jvm 1 | 2019.06.26 02:44:47 INFO app[o.s.a.SchedulerImpl] Process[es] is stopped
jvm 1 | 2019.06.26 02:44:47 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped
wrapper | <-- Wrapper Stopped

Below error is logged in es.log:

2019.06.26 02:44:47 WARN es[o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init

Does that mean i need to start Elasticsearch separately and then run sonar.sh as i am running sonar.sh as root.
Please suggest.

Hello,
You cannot run sonarqube as root as ES 5 prevents this and it is not possible to run components separately.
So you have to run it with a dedicated user.
Alex.

Hi Alex,

I tried running them together using root user. In that case the service starts and then exits with value1.
With non root user, i am not even able to start the service. Please suggest.

I am using below link to refer for installation:

https://docs.sonarqube.org/latest/setup/get-started-2-minutes/

Please share the logs to give me more context.

es.txt (15.7 KB) sonar.txt (15.6 KB)

Alex,

I could only find es.log and sonar.log. Let me know if any other details are required.

Shalini,
The last log of Elastic Search is clear, you are still trying to run sonarqube as root:

2019.06.26 02:44:47 WARN es[o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root

And the timestamp correspond to the on of the exit value 1 for es in the sonar.log:

2019.06.26 02:44:47 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1

So you have to start sonarqube with a different user.
Alex.

Hi Alex,

It worked now. Thank you :slight_smile:

I’m also facing same issue,

Does that user should have Sudo Persmission ?

Regards
Saurabh

Saurabh,

sudo permission is not required. i tried with non root user and ./sonar.sh console command and it worked for me.