SonarQube stop working after Process[es] is up- Process[Web Server] is stoppedProcess[ElasticSearch]

Hello all,
I am using sonarqube-9.7.1 and Java jdk 11.0.16, when I am start StartSonar.bat the log i get is,

Starting SonarQube...
2023.02.10 10:14:47 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube-9.7.1.62043\temp
2023.02.10 10:14:47 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:53214]
2023.02.10 10:14:47 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [C:\sonarqube-9.7.1.62043\elasticsearch]: C:\Program Files\Java\jdk-11.0.16.1\bin\java -XX:+UseG1GC -Djava.io.tmpdir=C:\sonarqube-9.7.1.62043\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 -Djna.tmpdir=C:\sonarqube-9.7.1.62043\temp -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 -Dlog4j2.formatMsgNoLookups=true -Djava.locale.providers=COMPAT -Dcom.redhat.fips=false -Xmx512m -Xms512m -XX:MaxDirectMemorySize=256m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\sonarqube-9.7.1.62043\elasticsearch -Des.path.conf=C:\sonarqube-9.7.1.62043\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
2023.02.10 10:14:47 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2023.02.10 10:14:53 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2023.02.10 10:14:53 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [C:\sonarqube-9.7.1.62043]: C:\Program Files\Java\jdk-11.0.16.1\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=C:\sonarqube-9.7.1.62043\temp -XX:-OmitStackTraceInFastThrow --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 --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-9.7.1.62043.jar;C:\sonarqube-9.7.1.62043\lib\jdbc\h2\h2-2.1.214.jar org.sonar.server.app.WebServer C:\sonarqube-9.7.1.62043\temp\sq-process5905552187652102478properties
2023.02.10 10:14:54 INFO  app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped
2023.02.10 10:14:54 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.02.10 10:14:54 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped

and my log files are:-
Es.log
es.log (4.2 KB)
Sonar.log
sonar.log (2.7 KB)
Web.log
web.log (4.4 KB)

Caused by: 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:459)
	at java.base/sun.nio.ch.Net.bind(Net.java:448)
	at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
	at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:274)
	at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:229)
	at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1227)
	at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1240)
	at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:603)
	at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:80)
	at org.apache.catalina.connector.Connector.initInternal(Connector.java:1046)
	... 12 common frames omitted

It looks like the port defined by sonar.web.port in your conf/sonar.properties file is already in use (by default: 9000). You should use a different port, or make sure there’s nothing else running on that port you don’t expect.

1 Like

Okay, Colin thank you for reply Will check and change the port.

Hello Colin, I tried using another port and also killing the process on the same port but got the same results(error). please help me out from here if possible.

Did you receive the same error in the web.log file, or just a failure starting the service overall?

1 Like

Yes, I think I got the same error. for reference only I have attached it below.

2023.02.15 10:27:03 INFO  web[][o.s.p.ProcessEntryPoint] Starting Web Server
2023.02.15 10:27:04 ERROR web[][o.s.s.a.EmbeddedTomcat] Fail to start web server
org.apache.catalina.LifecycleException: Protocol handler initialization failed
	at org.apache.catalina.connector.Connector.initInternal(Connector.java:1049)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
	at org.apache.catalina.core.StandardService.initInternal(StandardService.java:556)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
	at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:1042)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
	at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
	at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:72)
	at org.sonar.server.app.WebServer.start(WebServer.java:55)
	at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:97)
	at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:81)
	at org.sonar.server.app.WebServer.main(WebServer.java:104)
Caused by: 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:459)
	at java.base/sun.nio.ch.Net.bind(Net.java:448)
	at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
	at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:274)
	at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:229)
	at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1227)
	at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1240)
	at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:603)
	at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:80)
	at org.apache.catalina.connector.Connector.initInternal(Connector.java:1046)
	... 12 common frames omitted
2023.02.15 10:27:04 WARN  web[][o.s.p.ProcessEntryPoint] Fail to start Web Server
java.lang.RuntimeException: org.apache.catalina.LifecycleException: Protocol handler initialization failed
	at com.google.common.base.Throwables.propagate(Throwables.java:242)
	at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:77)
	at org.sonar.server.app.WebServer.start(WebServer.java:55)
	at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:97)
	at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:81)
	at org.sonar.server.app.WebServer.main(WebServer.java:104)
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
	at org.apache.catalina.connector.Connector.initInternal(Connector.java:1049)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
	at org.apache.catalina.core.StandardService.initInternal(StandardService.java:556)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
	at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:1042)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
	at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
	at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:72)
	... 4 common frames omitted
Caused by: 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:459)
	at java.base/sun.nio.ch.Net.bind(Net.java:448)
	at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
	at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:274)
	at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:229)
	at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1227)
	at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1240)
	at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:603)
	at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:80)
	at org.apache.catalina.connector.Connector.initInternal(Connector.java:1046)
	... 12 common frames omitted
2023.02.15 10:27:04 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process

Hi Divyaraj is your issue got resolved ? If yes please do let me know how it got resolved as I am also facing the same issue.