13

I am trying to Setup SonarQube on Centos 6 VM with 6GB of RAM. The process always exits with 143.

On analysis I found that the JVM is being sent a SIGTERM signal and thus exiting. There are no core dumps and dmesg is also quite unhelpful. I also tried fiddling with the Memory options to no avail.

If some can help me debug this issue it will be quite useful. At least, I will have some idea why this software is being terminated.

jvm 1    | 2018.03.06 15:32:59 INFO  app[][o.e.p.PluginsService] no modules loaded
jvm 1    | 2018.03.06 15:32:59 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1    | 2018.03.06 15:33:07 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
jvm 1    | 2018.03.06 15:33:07 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/home/sonar/sonar/sonarqube-7.0]: /opt/jdk1.8.0_161/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/home/sonar/sonar/sonarqube-7.0/temp -Xrs -Xmx4g -Xms4g -XX:+HeapDumpOnOutOfMemoryError -cp ./lib/common/*:./lib/server/*:/home/sonar/sonar/sonarqube-7.0/lib/jdbc/mysql/mysql-connector-java-5.1.42.jar org.sonar.server.app.WebServer /home/sonar/sonar/sonarqube-7.0/temp/sq-process3024208901604150849properties
jvm 1    | 2018.03.06 15:33:12 INFO  app[][o.s.a.SchedulerImpl] Process [web] is stopped
jvm 1    | 2018.03.06 15:33:12 INFO  app[][o.s.a.SchedulerImpl] Process [es] is stopped
jvm 1    | 2018.03.06 15:33:12 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
jvm 1    | 2018.03.06 15:33:12 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
wrapper  | <-- Wrapper Stopped
Rekovni
  • 6,319
  • 3
  • 39
  • 62
user1740925
  • 139
  • 1
  • 1
  • 4
  • 1
    Can you please share web.log, ce.log and es.log files ? Wild guest of your issue : maybe you are using root acount and this is not possible. – Eric Hartmann Mar 06 '18 at 14:40
  • You might not have enough memory available on the machine for all the processes running on it. Have you checked SQ's ES process is not killed by the OOM Killer: https://stackoverflow.com/questions/624857/finding-which-process-was-killed-by-linux-oom-killer – Seb - SonarSource Team Mar 07 '18 at 08:10
  • Did you get this resolved? I am seeing the same problem. I do not have any OOM process killer log entries. – John Elion Apr 16 '18 at 11:30
  • It seems like Sonarqube is exiting with code 143 for any error encountered in the startup process (ex : database not available). You simply need to check all log files to have details about the error (in my case : web.log). – Amael H. Dec 15 '18 at 12:13

11 Answers11

6

I have been experiencing this as well, but I managed to cure it this morning.

For me, the problem was not bad Elastic system configuration, invalid database credentials, and it was not killed by the OOM killer. For me the problem was that we had the "sonar-cfamily-plugin-5.1.10083.jar" in the extensions/plugins folder, but we did not have a license to use it (we are a Java shop, I doubt anyone even tried to run it). In SonarQube 6.6, we got warnings about it being unlicensed, but nothing crashed. In 6.7, as well as 6.7.3 and 7.0, es crashed with 143 (I believe we still got the warning, but since it was in our 6.6 logs I didn't consider it to be a problem.)

I figured this out because I tried a 'super clean' install (no plugins) and SonarQube 7.0 stayed up; adding the plugins back, es crashed with 143. CFamily was the first plugin I tried to remove (since we don't really use it) and SonarQube stayed up.

I haven't gone back to 6.7 to see if removing an unlicenses cfamily plugin clears up the ES 143 exit there as well, but if you are experiencing this maddening error and none of the other suggestions apply to you, this might be something to look at. At least, something to try would be to remove all your plugins and see if SonarQube starts correctly; then one by one add them back until you find the one that introduces the ES 143 exit problem.

John Elion
  • 1,323
  • 1
  • 16
  • 30
4

What worked for me to overcome 143 error and make my local server running normally (http://localhost:9000):

I was following this https://medium.com/@agavatar/code-coverage-reports-in-sonarqube-for-swift-on-macos-49797b6a8fea

then i started getting error 143 and when I removed backelite-sonar-swift-plugin-0.4.2.jar from ...<my-path>./sonarqube-7.6/extensions/plugins

voila ! it worked

eaccmk
  • 366
  • 2
  • 6
  • I was following the same exact tutorial and ran into the same problem. If we remove the plugin, however, it defeats the purpose. How are we suppose to do swift analysis if we don't use the plugin? – Will Feb 14 '19 at 15:40
  • I tried downloading [LTS](https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-6.7.6.zip) (Long-term Support): SonarQube 6.7.x It worked for me – Dhruv Feb 15 '19 at 10:07
  • I was trying to start the sonarqube web console but always getting 143 error. And when remove backelite-sonar-swift-plugin-0.4.4.jar, it worked perfectly. I am using SonarQube 7.7 version as from 7.9 onward it require java 11 and our project worked on java 8 – Saurabh Mar 27 '20 at 03:49
  • Your issue was resolved by deleting plugin because he was using old version of sonarqube where he require to add plugins where as in new version most of language plugin are already bundled to check more see https://docs.sonarqube.org/latest/instance-administration/plugin-version-matrix/ – Abhishek Bansal Apr 07 '22 at 11:55
3

I just encountered this today and upon checking web.log ($SONARQUBE_HOME/sonarqube/logs), the following was logged:

2019.02.28 15:47:38 INFO  web[][o.s.s.p.d.m.c.MssqlCharsetHandler] Verify that database collation is case-sensitive and accent-sensitive
2019.02.28 15:47:38 ERROR web[][o.s.s.p.Platform] Web server startup failed: Database collation must be case-sensitive and accent-sensitive. It is SQL_Latin1_General_CP1_CI_AS but should be SQL_Latin1_General_CP1_CS_AS.

It worked once I fixed the collation (missed it out during DB set up). Hope this helps someone else with the same issue.

ccjx
  • 105
  • 6
1

I ran into the same problem that eaccmk ran into, but I realized my problem is that I was using SonarQube 7.6 when I should have been using the Long-term Support version that is 6.7.6

Switching to the 6.7.6 and putting the plugin there made the code start up successfully without the 143 error.

Will
  • 1,697
  • 17
  • 34
1

Check in your /opt/sonarqube/conf/sonar.propeties, the following line:

sonar.jdbc.url=jdbc:postgresql://localhost/your_db_schema

For example, if you inster this in PG

CREATE DATABASE db_sonarqube;
…
…
\q

Your line is going to be like this:

sonar.jdbc.url=jdbc:postgresql://localhost/db_sonarqube
TAbdiukov
  • 1,185
  • 3
  • 12
  • 25
1

For me, the issue was my database was inaccessible from the Sonar instance. On AWS, having moved the instance around (AMI, launch new instance etc) it needed to be allowed in via the RDS security group.

Scott Bennett-McLeish
  • 9,187
  • 11
  • 41
  • 47
1

For me, the issue was my database was inaccessible from the Sonar instance. On AWS, having moved the instance around (AMI, launch new instance etc) it needed to be allowed in via the RDS security group.

The error was clear once I found the exception in the sonar-directory/logs/web.log file:

java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings ...

Scott Bennett-McLeish
  • 9,187
  • 11
  • 41
  • 47
1

I needed to update my mysql version

SonarQube supports MySQL 5.6 & 5.7

Check your existing version number

mysql -u <username> -p
SELECT VERSION()

If the version is not 5.6 or 5.7, then uninstall the existing mysql

sudo yum -y remove mysql

Install MySQL 5.6

sudo yum localinstall http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm -y
sudo yum install mysql-community-server -y

Start MySQL

sudo service mysqld start
Weebe
  • 66
  • 4
0

Old question but answer is still relevant. Reasons for 143 are as below - * You manually copied a plugin(.jar) to $SONAR_HOME/extensions/Plugins. * Unlicensed plugin * Incompatible plugin.

ManjunathK
  • 377
  • 3
  • 13
0

I got the same issue, and turns out I didn't create the database.

After creating the database, and restart sonarqube, it's ok.

Eric
  • 22,183
  • 20
  • 145
  • 196
0

A bit late to the party here, but can hopefully be useful.

The error logs in Sonar gave me nothing. For me this 143 exit code was because I had some other process running on port 9000, which is the default sonar port.

Go into conf/sonar.properties and edit port to something else, e.g. sonar.web.port=9009

Then start up your server again!

larsesen
  • 63
  • 2
  • 8