Having problem with StartSonar.bat

SonarQube: sonarqube-developer-8.8.0.42792

Cannot proceed further with the StartSonar.bat.
Please kindly advise.

Here is the log:
→ 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.

2021.04.09 10:52:17 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube\temp
2021.04.09 10:52:17 INFO app[o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:50955]
2021.04.09 10:52:17 INFO app[o.s.a.ProcessLauncherImpl] Launch process[[key=‘es’, ipcIndex=1, logFilenamePrefix=es]] from [C:\sonarqube\elasticsearch]: C:\Program Files\Java\jdk-11.0.10\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Djava.io.tmpdir=C:\sonarqube\temp -XX:ErrorFile=…/logs/es_hs_err_pid%p.log -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 -Dio.netty.allocator.numDirectArenas=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.locale.providers=COMPAT -Xmx512m -Xms512m -XX:MaxDirectMemorySize=256m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\sonarqube\elasticsearch -Des.path.conf=C:\sonarqube\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
2021.04.09 10:52:17 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
Java HotSpot™ 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
uncaught exception in thread [main]
BindHttpException[Failed to bind to 127.0.0.1:9001]; nested: BindException[Address already in use: bind];
Likely root cause: java.net.BindException: Address already in use: bind
at java.base/sun.nio.ch.Net.bind0(Native Method)
at java.base/sun.nio.ch.Net.bind(Net.java:455)
at java.base/sun.nio.ch.Net.bind(Net.java:447)
at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134)
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:550)
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491)
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973)
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:248)
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at java.base/java.lang.Thread.run(Thread.java:834)
For complete error details, refer to the log at C:\sonarqube\logs\sonarqube.log
2021.04.09 10:52:24 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2021.04.09 10:52:24 INFO app[o.s.a.SchedulerImpl] Process[es] is stopped
2021.04.09 10:52:24 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped
← Wrapper Stopped

Hey @bencch ,

It looks like HTTP port of Elasticsearch is already in use on your machine, which is clearly described in the logs you have shared:

BindHttpException[Failed to bind to 127.0.0.1:9001]; nested: BindException[Address already in use: bind]; Likely root cause: java.net.BindException: Address already in use: bind

If you cannot remove service which is using 9001 port, you can change the port of ES easily in sonar.properties by adding this property:
sonar.search.port=9002

Cheers,

Hi there
had the same problem:
BindHttpException[Failed to bind to 127.0.0.1:9001]; nested: BindException[Address already in use: bind];
As correctly identified the issue was that port was in use, however the suggested approach didn’t resolve the problem for me.

Hence here is what worked for me:

Identify ports in windows, I found either of the link helpful:
How to Check Open TCP/IP Ports in Windows (howtogeek.com)
or How to Check Which Ports Are in Use in Windows 10 (windowsloop.com)

After that disable the process tied to the 9001 port and rerun the StartSonar.bat file. You should be able to confirm in the log: the SonarQube is up