Problem launching Elasticsearch on Windows 10

I get the following error log while launching elasticsearch.

[2019-01-08T16:18:02,337][ERROR][o.e.b.Bootstrap ] [LRI-L03240] Exception
org.elasticsearch.transport.BindTransportException: Failed to bind to [9300]
at org.elasticsearch.transport.TcpTransport.bindToPort(TcpTransport.java:583) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.transport.TcpTransport.bindServer(TcpTransport.java:548) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.transport.netty4.Netty4Transport.doStart(Netty4Transport.java:132) ~[?:?]
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:62) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.transport.TransportService.doStart(TransportService.java:255) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:62) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.node.Node.start(Node.java:720) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:269) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) [elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) [elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127) [elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-6.5.4.jar:6.5.4]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) [elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86) [elasticsearch-6.5.4.jar:6.5.4]
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
at sun.nio.ch.Net.bind(Net.java:433) ~[?:?]
at sun.nio.ch.Net.bind(Net.java:425) ~[?:?]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:?]
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:130) ~[?:?]
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:558) ~[?:?]
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1358) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:501) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:486) ~[?:?]
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:1019) ~[?:?]
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:254) ~[?:?]
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:366) ~[?:?]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[?:?]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[?:?]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462) ~[?:?]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897) ~[?:?]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_191]
[2019-01-08T16:18:02,347][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [LRI-L03240] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: BindTransportException[Failed to bind to [9300]]; nested: BindException[Address already in use: bind];
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:140) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.5.4.jar:6.5.4]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86) ~[elasticsearch-6.5.4.jar:6.5.4]
Caused by: org.elasticsearch.transport.BindTransportException: Failed to bind to [9300]
at org.elasticsearch.transport.TcpTransport.bindToPort(TcpTransport.java:583) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.transport.TcpTransport.bindServer(TcpTransport.java:548) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.transport.netty4.Netty4Transport.doStart(Netty4Transport.java:132) ~[?:?]
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:62) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.transport.TransportService.doStart(TransportService.java:255) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:62) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.node.Node.start(Node.java:720) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:269) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-6.5.4.jar:6.5.4]
... 6 more

I have followed the installation instruction from this page https://www.elastic.co/guide/en/elasticsearch/reference/6.5/windows.html but not installed Elasticsearch as a service as I don't have rights for that.
I'm trying to start Elasticsearch from the command line when I get the error mentioned above.

Thank you in advance for all your help.
Regards,
Peter

I have the following elasticsearch.exe --debug-env

Elasticsearch

ES_HOME (in order of precedence)

  • HomeDirectoryProcessVariable = C:\Program Files\Elastic\Elasticsearch\6.5.4\
  • HomeDirectoryUserVariable =
  • HomeDirectoryMachineVariable = C:\Program Files\Elastic\Elasticsearch\6.5.4\
  • From executable location = C:\Program Files\Elastic\Elasticsearch\6.5.4
    ES_PATH_CONF (in order of precedence)
  • ConfigDirectoryProcessVariable = C:\ProgramData\Elastic\Elasticsearch\config
  • ConfigDirectoryUserVariable =
  • ConfigDirectoryMachineVariable = C:\ProgramData\Elastic\Elasticsearch\config
  • Fallback to ES_HOME = C:\Program Files\Elastic\Elasticsearch\6.5.4\config

Java

Java paths

  • current = C:\Program Files\Java\jdk1.8.0_191\bin\java.exe
    Java Candidates (in order of precedence)
  • JavaHomeProcessVariable =
  • JavaHomeUserVariable =
  • JavaHomeMachineVariable =
  • JdkRegistry64 = C:\Program Files\Java\jdk1.8.0_191
  • JreRegistry64 = C:\Program Files\Java\jre1.8.0_192
  • JdkRegistry32 =
  • JreRegistry32 =
    Java checks
  • Using32BitJava = False
  • JAVA_HOME as machine and user variable = False

Something (probably elasticsearch) is already running on that port. That's why you can not launch it again.

Indeed that seem to have been the problem. Don't know why or how elasticsearch started twice, I could not see it in Task Manager, but after a restart of windows I was able to start elasticsearch manually from the command line.
Thank you for your help :slight_smile:

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