SonarQube fails to start in console

Good day,
I am trying to set up SonarQube on a RHEL 8 server. I am using the latest version 9.0.0.45539 which was downloaded this morning (although, I have had the same issue with an older version). I have updated java to 16.0.1 (2021-04-20):

./java -version
openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment (build 16.0.1+9-24)
OpenJDK 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)

As this is a 64-bit OS, I have increased the vm.max_map_count as per the config file directions:

cat /etc/sysctl.conf
#other sections removed...
vm.max_map_count=262144

In an effort to troubleshoot, I have increased the logging level in the wrapper.conf. The portions above the “do not edit” section are as follows:

# Path to JVM executable. By default it must be available in PATH.
wrapper.java.command=/usr/lib/jvm/jdk-16.0.1/bin/java
wrapper.debug=TRUE

From what I can tell, it seems to be starting the wrapper, but then fails to connect to it. Here is the sonar.log file (with debug output):

--> Wrapper Started as Console
Using tick timer.
server listening on port 32000.
Command[0] : /usr/lib/jvm/jdk-16.0.1/bin/java
Command[1] : -Dsonar.wrapped=true
Command[2] : -Djava.awt.headless=true
Command[3] : -Xms8m
Command[4] : -Xmx32m
Command[5] : -Djava.library.path=./lib
Command[6] : -classpath
Command[7] : ../../lib/sonar-application-9.0.0.45539.jar:../../lib/jsw/wrapper-3.2.3.jar:../../lib/sonar-shutdowner-9.0.0.45539.jar
Command[8] : -Dwrapper.key=hEaM8IAFWHXOeD5Q
Command[9] : -Dwrapper.port=32000
Command[10] : -Dwrapper.jvm.port.min=31000
Command[11] : -Dwrapper.jvm.port.max=31999
Command[12] : -Dwrapper.debug=TRUE
Command[13] : -Dwrapper.pid=99542
Command[14] : -Dwrapper.version=3.2.3
Command[15] : -Dwrapper.native_library=wrapper
Command[16] : -Dwrapper.cpu.timeout=10
Command[17] : -Dwrapper.jvmid=1
Command[18] : org.tanukisoftware.wrapper.WrapperSimpleApp
Command[19] : org.sonar.application.App
Launching a JVM...
WrapperManager class initialized by thread: main  Using classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@443b7951
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

Wrapper Manager: JVM #1
Running a 64-bit JVM.
Wrapper Manager: Registering shutdown hook
Wrapper Manager: Using wrapper
Load native library.  One or more attempts may fail if platform specific libraries do not exist.
Loading native library failed: libwrapper-linux-x86-64.so  Cause: java.lang.UnsatisfiedLinkError: no wrapper-linux-x86-64 in java.library.path: ./lib
Loaded native library: libwrapper.so
Calling native initialization method.
Inside native WrapperManager initialization method
Java Version   : 16.0.1+9-24 OpenJDK 64-Bit Server VM
Java VM Vendor : Oracle Corporation

Startup runner thread started.
Control event monitor thread started.
WrapperManager.start(org.tanukisoftware.wrapper.WrapperSimpleApp@6d03e736, args[]) called by thread: main
Communications runner thread started.
Open socket to wrapper...Wrapper-Connection
Startup failed: Timed out waiting for a signal from the JVM.
JVM did not exit on request, terminated
JVM exited on its own while waiting to kill the application.
Signal trapped.  Details:
  signal number=17 (SIGCHLD), source="unknown"
Received SIGCHLD, checking JVM process status.
JVM exited in response to signal SIGKILL (9).
JVM process exited with a code of 1, setting the wrapper exit code to 1.
JVM Restarts disabled.  Shutting down.
<-- Wrapper Stopped

As shown above, it seems to be terminating on Startup failed: Timed out waiting for a signal from the JVM.. I have previously attempted to increase the timeouts for the wrapper with no success, although I have not tried it with this version of SonarQube.

I’d appreciate any insights as I am lost as how to proceed at this point.
Thanks!

Hi @camgra ,

Welcome to SonarSource community! :sonarsource:

Please check these threads and see if they help resolve your issue:

Hi,
Thank you for your welcome!

I had previously gone through those forum posts. The summary of the posts are more or less as follows:

  • Java Version

I have installed the latest version of OpenJDK, so the java version should not be an issue.

  • Permissions

I have run it via sudo but as I know there are issues with ElasticSearch and running as root, I have also changed ownership of all folders associated with SonarQube and have also attempted execution as a dedicated user account (svcSonarQube) which is also my preferred setup

  • Native Windows problems

I am running this in Redhat Enterprise Linux, so while I am reviewing the Windows issues, the noted ones seem specific to the Windows environment specifically.

  • Use of unsupported network drives

I have the binaries and configuration in /opt/sonarqube and data/temp in /var/sonarqube with appropriate permissions set up for both. No network drives here.

  • Use of unsupported versions

I am using the latest version of SonarQube

One test I did this morning that I hadn’t mentioned previously: To ensure that the JVM is running, I executed the console command ./sonar.sh console and in another console session, ran a netstat command which produced the following:

netstat |grep 32000
tcp6       0      1 localhost:31000         localhost:32000         SYN_SENT

So, the JVM is being created, but it is not connecting to it.

I decided to disable the firewall and give it another go. It turns out that the firewall seems to be the problem, at least in terms of connecting to the JVM. This was resolved by adding a firewall rule to allow all internal traffic on the server.

With that resolved, I am pulling another error, but I will investigate that separately.

Thanks

1 Like

Few issues with this:

  1. As noted above, the firewall needs to allow for loopback connections. While I didn’t bother to nail down the specific ports this requires, most likely allowance for ports 31000 and 32000 would probably fix it
  2. The java version needs to be JRE 11. I had a later version installed.
  3. There is a system conflict between FIPS in RHEL and FIPS in Java, so that had to be resolved. For details on that, see How to disable FIPS for java when FIPS is enabled on RHEL 8? - Red Hat Customer Portal

Once these 3 issues were resolved, it now works in console mode.

1 Like

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