Unable to start sonarqube java.net.ConnectException

I have installed sonarqube 7.7 on windows 10 but when I’m trying to start the sonarqube server using the StartSonar.bat file It is giving me the following error

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    | Failed to connect to the Wrapper at port 32000.
jvm 1    | java.net.ConnectException: Connection timed out: connect
jvm 1    | Exiting JVM...
wrapper  | Startup failed: Timed out waiting for a signal from the JVM.
wrapper  | JVM did not exit on request, terminated
wrapper  | JVM Restarts disabled.  Shutting down.
wrapper  | <-- Wrapper Stopped
Press any key to continue . . .

This is how my wrapper.conf looks like

# Path to JVM executable. By default it must be available in PATH.
# Can be an absolute path, for example:
#wrapper.java.command=/path/to/my/jdk/bin/java
wrapper.java.command=java


#
# DO NOT EDIT THE FOLLOWING SECTIONS
#


#********************************************************************
# Wrapper Java
#********************************************************************
wrapper.java.additional.1=-Dsonar.wrapped=true
wrapper.java.additional.2=-Djava.awt.headless=true
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
wrapper.java.classpath.1=../../lib/jsw/*.jar
wrapper.java.classpath.2=../../lib/common/*.jar
wrapper.java.classpath.3=../../lib/*.jar
wrapper.java.library.path.1=./lib
wrapper.app.parameter.1=org.sonar.application.App
wrapper.java.initmemory=8
wrapper.java.maxmemory=32

#********************************************************************
# Wrapper Logs
#********************************************************************

wrapper.console.format=PM
wrapper.console.loglevel=INFO
wrapper.logfile=../../logs/sonar.log
wrapper.logfile.format=M
wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before
#  the log is rolled. Size is specified in bytes.  The default value
#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
#wrapper.logfile.maxsize=0

# Maximum number of rolled log files which will be allowed before old
#  files are deleted.  The default value of 0 implies no limit.
#wrapper.logfile.maxfiles=0

# Log Level for sys/event log output.  (See docs for log levels)
wrapper.syslog.loglevel=NONE

#********************************************************************
# Wrapper Windows Properties
#********************************************************************
# Title to use when running as a console
wrapper.console.title=SonarQube

# Disallow start of multiple instances of an application at the same time on Windows
wrapper.single_invocation=true

#********************************************************************
# Wrapper Windows NT/2000/XP Service Properties
#********************************************************************
# WARNING - Do not modify any of these properties when an application
#  using this configuration file has been installed as a service.
#  Please uninstall the service before modifying this section.  The
#  service can then be reinstalled.

# Name of the service
wrapper.ntservice.name=SonarQube

# Display name of the service
wrapper.ntservice.displayname=SonarQube

# Description of the service
wrapper.ntservice.description=SonarQube

# Service dependencies.  Add dependencies as needed starting from 1
wrapper.ntservice.dependency.1=

# Mode in which the service is installed.  AUTO_START or DEMAND_START
wrapper.ntservice.starttype=AUTO_START

# Allow the service to interact with the desktop.
wrapper.ntservice.interactive=false

#********************************************************************
# Forking Properties
#********************************************************************
wrapper.disable_restarts=TRUE
wrapper.ping.timeout=0
wrapper.shutdown.timeout=300
wrapper.jvm_exit.timeout=300

This is how my sonar.log file looks like

--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
Failed to connect to the Wrapper at port 32000.
java.net.ConnectException: Connection timed out: connect
Exiting JVM...
Startup failed: Timed out waiting for a signal from the JVM.
JVM did not exit on request, terminated
JVM Restarts disabled.  Shutting down.
<-- Wrapper Stopped

My Java version is

java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)

I’m not able to figure out what is going wrong. Please help

Hello @sachinmukherjee,

A user ran into this issue in the past (SonarQube 6.7.5 startup failure: Failed to connect to the Wrapper at port 0). He was using a network drive which is not supported.
Any chance that you are doing the same here?

Note that the error:

comes from the underlying component SQ uses (Tanuki Wrapper) which apparently fails to instantiate a JVM to launch other SQ processes.

Cheers

Hello @Antoine.

No, I’m trying to run it in my local drive i.e C drive.

Hello @sachinmukherjee,

Ok. First thing, I can see you’re trying to run SQ 7.7 which is an unsupported version now. If you want to stick to the LTS, please use 7.9 (patch release 7.9.4), or to the latest version please use 8.5.
Both requires Java 11 (I can see you were using Java 8 here).

If the issue still appears on your new install, you can use wrapper.debug=true in the wrapper.conf. This will output in sonar.log what exactly the wrapper does and where it fails. I’m sure from here you will be able to understand what is the problem.

Cheers,

Hello @Antoine

I followed the above steps. Downloaded sonarqube 8.4 and installed java 11 still I’m getting the same error. I have gone through the logs too but not able to figure out what is missing. I have attached the logs. Please helpsonar.log (7.6 KB)

Hello @sachinmukherjee,

We checked around here and we never heard of such report in the past. As you are in a Windows environment, it’s possible that you have an Antivirus which is blocking some communication, even though they are local.
If that’s the case, please deactivate (of course temporarily, just to understand) any kind of security mechanism you may have and try again.

I hope this will help.

Antoine