Sonar service getting restarted automatically

I have installed 7.2.1 version of sonarqube and started the service in Ubuntu 18.04. But I am not able to get the dashboard. I could observe that the service is getting restarted automatically every 3/4 seconds.
Can someone help me on this issue?

Hi,

You used the word ‘service’ so I guess the OS is doing the re-starting. The question is what’s causing the stops. For that I suggested you get the service turned off, then examine the logs in $SONARQUBE_HOME/logs.

Ann

Hi Ann,

Sonar service is getting stopped after 25-30 seconds, As I have enabled restart always option in the service file it is restarting the service.
If I disable restart option in service file sonar service will be stopped after 25-30 seconds and it will never come up.
Refered the below 2 links for reference and followed the instruction metioned.


https://docs.sonarqube.org/display/SONAR/Requirements#Requirements-Prerequisite
PFB for the logs of sonar.log

2018.08.09 07:32:32 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2018.08.09 07:32:32 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.08.09 07:32:32 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonarqube/temp/conf/es
2018.08.09 07:32:32 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.08.09 07:32:32 INFO  app[][o.e.p.PluginsService] no modules loaded
2018.08.09 07:32:32 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.08.09 07:32:42 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2018.08.09 07:32:42 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-8-oracle/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -cp ./lib/common/*:./lib/server/*:/opt/sonarqube/lib/jdbc/postgresql/postgresql-42.2.1.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process886100551209611422properties
2018.08.09 07:32:46 INFO  app[][o.s.a.SchedulerImpl] Process [web] is stopped
2018.08.09 07:32:46 INFO  app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.08.09 07:32:46 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
2018.08.09 07:32:46 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143

Logs of Elastic search:

2018.08.09 07:40:53 INFO  es[][o.e.n.Node] initializing ...
2018.08.09 07:40:53 INFO  es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [26.4gb], net total_space [28.9gb], spins? [possibly], types [ext4]
2018.08.09 07:40:53 INFO  es[][o.e.e.NodeEnvironment] heap size [495.3mb], compressed ordinary object pointers [true]
2018.08.09 07:40:53 INFO  es[][o.e.n.Node] node name [sonarqube], node ID [DYdnGVgPQoqmjFMkXTw1yQ]
2018.08.09 07:40:53 INFO  es[][o.e.n.Node] version[5.6.3], pid[13433], build[1a2f265/2017-10-06T20:33:39.012Z], OS[Linux/4.15.0-1019-azure/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_181/25.181-b13]
2018.08.09 07:40:53 INFO  es[][o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djdk.io.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j.skipJansi=true, -Xms512m, -Xmx512m, -XX:+HeapDumpOnOutOfMemoryError, -Dbootstrap.system_call_filter=false, -Des.path.home=/opt/sonarqube/elasticsearch]
2018.08.09 07:40:54 INFO  es[][o.e.p.PluginsService] loaded module [aggs-matrix-stats]
2018.08.09 07:40:54 INFO  es[][o.e.p.PluginsService] loaded module [ingest-common]
2018.08.09 07:40:54 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2018.08.09 07:40:54 INFO  es[][o.e.p.PluginsService] loaded module [percolator]
2018.08.09 07:40:54 INFO  es[][o.e.p.PluginsService] loaded module [reindex]
2018.08.09 07:40:54 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2018.08.09 07:40:54 INFO  es[][o.e.p.PluginsService] no plugins loaded
2018.08.09 07:40:56 INFO  es[][o.e.d.DiscoveryModule] using discovery type [zen]
2018.08.09 07:40:57 INFO  es[][o.e.n.Node] initialized
2018.08.09 07:40:57 INFO  es[][o.e.n.Node] starting ...
2018.08.09 07:40:57 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2018.08.09 07:40:57 WARN  es[][o.e.b.BootstrapChecks] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
2018.08.09 07:41:00 INFO  es[][o.e.c.s.ClusterService] new_master {sonarqube}{DYdnGVgPQoqmjFMkXTw1yQ}{GkNYJG3RSjuzGrRZT9Kf5Q}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}, reason: zen-disco-elected-as-master ([0] nodes joined)
2018.08.09 07:41:00 INFO  es[][o.e.n.Node] started
2018.08.09 07:41:00 INFO  es[][o.e.g.GatewayService] recovered [0] indices into cluster_state
2018.08.09 07:41:04 INFO  es[][o.e.n.Node] stopping ...
2018.08.09 07:41:04 INFO  es[][o.e.n.Node] stopped
2018.08.09 07:41:04 INFO  es[][o.e.n.Node] closing ...
2018.08.09 07:41:04 INFO  es[][o.e.n.Node] closed

Could you please help me resolving this?.

Thanks,
Karthik

Hi Karthik,

The Troubleshooting documentation is a good start, to understand which log files you need to review to determine the root error. If you look at sonar.log you’ve shared:

2018.08.09 07:32:42 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2018.08.09 07:32:42 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-8-oracle/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -cp ./lib/common/*:./lib/server/*:/opt/sonarqube/lib/jdbc/postgresql/postgresql-42.2.1.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process886100551209611422properties
2018.08.09 07:32:46 INFO  app[][o.s.a.SchedulerImpl] Process [web] is stopped

ES (ElasticSearch) process does start, however it’s the web process that fails to start. Reviewing web.log should therefore help you narrow-down the actual startup error, and determine the potential resolution.

Hi Nicolas,

Thanks for your input, I got the issue resolved. Database password was not rite.