<h2>Web Server failed to start. Error: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:<PORT> while starting Mid Web Server</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Issue </h3><section><ul><li>As a part of Push event connector or Agent client collector installation, the Mid Web Server is created. While starting the Mid Webserver below error is observed:</li></ul> <p style="padding-left: 40px; text-align: left;"><span style="background-color: #ff0000; color: #ffffff;">Web Server failed to start. Error: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:8085</span></p> <p style="padding-left: 40px; text-align: left;"><span style="background-color: #ff0000; color: #ffffff;"><img style="border: 2px solid black; align: baseline;" src="sys_attachment.do?sys_id=af99db801bc9b090d01143f6fe4bcb21" width="934" height="472" align="baseline" border="2" /></span></p></section></div><div ><h3 >Cause</h3><section><ul><li>This error is observed when the port used to configure is already used by some other process on the mid-server host. </li><li>When we enable mid debug logs and check the agent logs, we see the below error.</li></ul> <pre style="padding-left: 40px;">Extension Container: com.service_now.mid.webserver.jetty.WebServer SEVERE *** ERROR *** (137071) com.service_now.mid.webserver.jetty.WebServer - Failed to start web server, Exception Message: IOException: Failed to bind to 0.0.0.0/0.0.0.0:8085, Stack Trace: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:8085<br />at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:346)<br />at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:307)<br />at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)<br />at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:231)<br />at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)<br />at org.eclipse.jetty.server.Server.doStart(Server.java:385)<br />at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)<br />at com.service_now.mid.webserver.jetty.WebServer.startListener(WebServer.java:166)<br />at com.service_now.mid.webserver.jetty.WebServer.run(WebServer.java:127)<br />at com.service_now.mid.util.WrappedRunnable.run(WrappedRunnable.java:64)<br />at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)<br />at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)<br />at java.base/java.lang.Thread.run(Thread.java:834)<br /><span style="background-color: #ff0000; color: #ffffff;">Caused by: java.net.BindException: Address already in use: bind</span><br />at java.base/sun.nio.ch.Net.bind0(Native Method)<br />at java.base/sun.nio.ch.Net.bind(Net.java:455)<br />at java.base/sun.nio.ch.Net.bind(Net.java:447)<br />at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)<br />at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:80)<br />at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:342)</pre></section></div><div ><h3 >Resolution</h3><section><ul><li>In order to make it work, the port needs to be changed to some other port that is <em><strong>Open</strong></em> and <em><strong>not used by any other process</strong></em> on the mid host. <br /></li><li>Kindly follow the below steps to change the port.<br /><br /> <ul><li>Connect to the Instance and Navigate to "Mid Web Server".</li><li>Open the impacted record and Stop the service</li><li>Change the Port to the new Port and start the service.<br /><br /></li></ul> </li><li>The Service will come up without any error.</li></ul></section></div></article></div>