Sonarqube process on ubuntu server exited with error code -143

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    using sonar 7.9.3 LTS version with Ubuntu 18-04,openjdk 11.0.7
    VM having 4GB RAM & 2 vCPU
  • what are you trying to achieve
    to start sonarqube process on standalone ubuntu server
  • what have you tried so far to achieve this
    to launch this command
    sudo -u sonar bash /opt/sonarqube/bin/linux-x86-64/sonar.sh start
    changed all permissions all folders inside /opt/sonarqube & also populate log files with errors.
    checked free RAM and RAM usage while sonar process started & it looked all fine.

2020.06.10 07:10:06 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2020.06.10 07:10:06 INFO app[o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2020.06.10 07:10:06 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=‘es’, ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2020.06.10 07:10:06 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2020.06.10 07:10:07 INFO app[o.e.p.PluginsService] no modules loaded
2020.06.10 07:10:07 INFO app[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020.06.10 07:10:22 INFO app[o.s.a.SchedulerImpl] Process[es] is up
2020.06.10 07:10:22 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=‘web’, ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-11-openjdk-amd64/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -server -Dhttp.nonProxyHosts=localhost|127.|[::1] -cp ./lib/common/:/opt/sonarqube/lib/jdbc/postgresql/postgresql-42.2.5.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process13651517763050293685properties
2020.06.10 07:10:37 INFO app[o.s.a.SchedulerImpl] Process[web] is stopped
2020.06.10 07:10:37 INFO app[o.s.a.SchedulerImpl] Process[es] is stopped
2020.06.10 07:10:37 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped
2020.06.10 07:10:37 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 143

also attaching the es.log file for elastic search logs

2020.06.10 08:02:57 INFO es[o.e.e.NodeEnvironment] using [1] data paths, mounts [[/ (/dev/nvme0n1p1)]], net usable_space [46gb], net total_space [48.4gb], types [ext4]
2020.06.10 08:02:57 INFO es[o.e.e.NodeEnvironment] heap size [495.3mb], compressed ordinary object pointers [true]
2020.06.10 08:02:57 INFO es[o.e.n.Node] node name [sonarqube], node ID [4QRba_VRQVCa9r3YfIrQOw]
2020.06.10 08:02:57 INFO es[o.e.n.Node] version[6.8.0], pid[14364], build[default/tar/65b6179/2019-05-15T20:06:13.172855Z], OS[Linux/4.15.0-1065-aws/amd64], JVM[Ubuntu/OpenJDK 64-Bit Server VM/11.0.7/11.0.7+10-post-Ubuntu-2ubuntu218.04]
2020.06.10 08:02:57 INFO es[o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/opt/sonarqube/temp, -XX:ErrorFile=…/logs/es_hs_err_pid%p.log, -Des.enforce.bootstrap.checks=true, -Xmx512m, -Xms512m, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/opt/sonarqube/elasticsearch, -Des.path.conf=/opt/sonarqube/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar]
2020.06.10 08:02:58 INFO es[o.e.p.PluginsService] loaded module [analysis-common]
2020.06.10 08:02:58 INFO es[o.e.p.PluginsService] loaded module [lang-painless]
2020.06.10 08:02:58 INFO es[o.e.p.PluginsService] loaded module [mapper-extras]
2020.06.10 08:02:58 INFO es[o.e.p.PluginsService] loaded module [parent-join]
2020.06.10 08:02:58 INFO es[o.e.p.PluginsService] loaded module [percolator]
2020.06.10 08:02:58 INFO es[o.e.p.PluginsService] loaded module [reindex]
2020.06.10 08:02:58 INFO es[o.e.p.PluginsService] loaded module [repository-url]
2020.06.10 08:02:58 INFO es[o.e.p.PluginsService] loaded module [transport-netty4]
2020.06.10 08:02:58 INFO es[o.e.p.PluginsService] no plugins loaded
2020.06.10 08:03:02 WARN es[o.e.d.c.s.Settings] [http.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.
2020.06.10 08:03:03 INFO es[o.e.d.DiscoveryModule] using discovery type [zen] and host providers [settings]
2020.06.10 08:03:04 INFO es[o.e.n.Node] initialized
2020.06.10 08:03:04 INFO es[o.e.n.Node] starting …
2020.06.10 08:03:04 INFO es[o.e.t.TransportService] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2020.06.10 08:03:04 INFO es[o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
2020.06.10 08:03:07 INFO es[o.e.c.s.MasterService] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {sonarqube}{4QRba_VRQVCa9r3YfIrQOw}{xFJ6fopfSnibPMf6DSUOGQ}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}
2020.06.10 08:03:07 INFO es[o.e.c.s.ClusterApplierService] new_master {sonarqube}{4QRba_VRQVCa9r3YfIrQOw}{xFJ6fopfSnibPMf6DSUOGQ}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}, reason: apply cluster state (from master [master {sonarqube}{4QRba_VRQVCa9r3YfIrQOw}{xFJ6fopfSnibPMf6DSUOGQ}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
2020.06.10 08:03:07 INFO es[o.e.n.Node] started
2020.06.10 08:03:07 INFO es[o.e.g.GatewayService] recovered [0] indices into cluster_state
2020.06.10 08:03:52 INFO es[o.e.n.Node] stopping …
2020.06.10 08:03:52 INFO es[o.e.n.Node] stopped
2020.06.10 08:03:52 INFO es[o.e.n.Node] closing …
2020.06.10 08:03:52 INFO es[o.e.n.Node] closed

Here i am attaching web logs also for reference.

2020.06.10 08:03:08 INFO web[o.s.p.ProcessEntryPoint] Starting web
2020.06.10 08:03:09 INFO web[o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2020.06.10 08:03:10 INFO web[o.e.p.PluginsService] no modules loaded
2020.06.10 08:03:10 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
2020.06.10 08:03:10 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
2020.06.10 08:03:10 INFO web[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020.06.10 08:03:12 INFO web[o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
2020.06.10 08:03:12 INFO web[o.s.s.p.LogServerVersion] SonarQube Server / 7.9.3.33349 / ded65927f38a2b43427165f32243223c10bd415c
2020.06.10 08:03:12 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://3.6.205.77/sonarqube
2020.06.10 08:03:22 ERROR web[o.s.s.p.Platform] Web server startup failed
java.lang.IllegalStateException: Fail to connect to database
at org.sonar.db.DefaultDatabase.start(DefaultDatabase.java:90)
at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(StartableCloseableSafeLifecyleStrategy.java:40)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
:

Looks like SonarQube cannot connect to your database. You should have more details about that in the web.log file. Look bellow that error message in the file, at the caused by, you should have more details (unreacheable server, invalid credentials, etc)

It is resolved after correcting web.log
error reflected in the logs itself.

Thanks for the help. really appreciated it

1 Like

I’m glad you figured it out :slight_smile:

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