# Exception when closing node

**URL:** <https://discuss.elastic.co/t/exception-when-closing-node/7849>\
**Category:** Elasticsearch\
**Created:** [May 24, 2012, 7:28pm UTC](https://discuss.elastic.co/t/exception-when-closing-node/7849 "2012-05-24T19:28:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [May 24, 2012, 7:28pm UTC](https://discuss.elastic.co/t/exception-when-closing-node/7849/1 "2012-05-24T19:28:12Z")

</div>

Since upgrading from 0.19.3 to 0.19.4, I get an exception whenever I  
close an (embedded) elasticsearch instance:

client.admin().indices().prepareFlush("\_all").execute().actionGet();  
client.close();  
node.close();

[warn] n.c.DefaultChannelPipeline - An exception was thrown by an  
exception handler.  
org.elasticsearch.common.netty.channel.ChannelException: Failed to  
create a selector.  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.start(AbstractNioWorker.java:  
162) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:  
314) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:  
38) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:  
298) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:  
38) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioChannelSink.execute(AbstractNioChannelSink.java:  
34) ~[elasticsearch-0.19.4.jar:na]  
Caused by: java.io.IOException: Unable to establish loopback  
connection  
at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:106) ~[na:  
1.6.0\_32]  
at java.security.AccessController.doPrivileged(Native Method)  
~[na:1.6.0\_32]  
at sun.nio.ch.PipeImpl.(PipeImpl.java:122) ~[na:  
1.6.0\_32]  
at  
sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)  
~[na:1.6.0\_32]  
at java.nio.channels.Pipe.open(Pipe.java:133) ~[na:1.6.0\_32]  
at  
sun.nio.ch.WindowsSelectorImpl.(WindowsSelectorImpl.java:104)  
~[na:1.6.0\_32]  
Caused by: java.nio.channels.ClosedByInterruptException: null  
at  
java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:  
184) ~[na:1.6.0\_32]  
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:  
543) ~[na:1.6.0\_32]  
at java.nio.channels.SocketChannel.open(SocketChannel.java:  
146) ~[na:1.6.0\_32]  
at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:78) ~[na:  
1.6.0\_32]  
at java.security.AccessController.doPrivileged(Native Method)  
~[na:1.6.0\_32]  
at sun.nio.ch.PipeImpl.(PipeImpl.java:122) ~[na:  
1.6.0\_32]  
[warn] n.c.DefaultChannelPipeline - An exception was thrown by an  
exception handler.  
org.elasticsearch.common.netty.channel.ChannelException: Failed to  
create a selector.  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.start(AbstractNioWorker.java:  
162) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:  
314) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:  
38) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:  
298) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:  
38) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioChannelSink.execute(AbstractNioChannelSink.java:  
34) ~[elasticsearch-0.19.4.jar:na]  
Caused by: java.io.IOException: Unable to establish loopback  
connection  
at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:106) ~[na:  
1.6.0\_32]  
at java.security.AccessController.doPrivileged(Native Method)  
~[na:1.6.0\_32]  
at sun.nio.ch.PipeImpl.(PipeImpl.java:122) ~[na:  
1.6.0\_32]  
at  
sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)  
~[na:1.6.0\_32]  
at java.nio.channels.Pipe.open(Pipe.java:133) ~[na:1.6.0\_32]  
at  
sun.nio.ch.WindowsSelectorImpl.(WindowsSelectorImpl.java:104)  
~[na:1.6.0\_32]  
Caused by: java.nio.channels.ClosedByInterruptException: null  
at  
java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:  
184) ~[na:1.6.0\_32]  
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:  
543) ~[na:1.6.0\_32]  
at java.nio.channels.SocketChannel.open(SocketChannel.java:  
146) ~[na:1.6.0\_32]  
at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:78) ~[na:  
1.6.0\_32]  
at java.security.AccessController.doPrivileged(Native Method)  
~[na:1.6.0\_32]  
at sun.nio.ch.PipeImpl.(PipeImpl.java:122) ~[na:  
1.6.0\_32]  
[warn] n.c.DefaultChannelPipeline - An exception was thrown by an  
exception handler.  
org.elasticsearch.common.netty.channel.ChannelException: Failed to  
create a selector.  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.start(AbstractNioWorker.java:  
162) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:  
314) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:  
38) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:  
298) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:  
38) ~[elasticsearch-0.19.4.jar:na]  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioChannelSink.execute(AbstractNioChannelSink.java:  
34) ~[elasticsearch-0.19.4.jar:na]  
Caused by: java.io.IOException: Unable to establish loopback  
connection  
at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:106) ~[na:  
1.6.0\_32]  
at java.security.AccessController.doPrivileged(Native Method)  
~[na:1.6.0\_32]  
at sun.nio.ch.PipeImpl.(PipeImpl.java:122) ~[na:  
1.6.0\_32]  
at  
sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)  
~[na:1.6.0\_32]  
at java.nio.channels.Pipe.open(Pipe.java:133) ~[na:1.6.0\_32]  
at  
sun.nio.ch.WindowsSelectorImpl.(WindowsSelectorImpl.java:104)  
~[na:1.6.0\_32]  
Caused by: java.nio.channels.ClosedByInterruptException: null  
at  
java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:  
184) ~[na:1.6.0\_32]  
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:  
543) ~[na:1.6.0\_32]  
at java.nio.channels.SocketChannel.open(SocketChannel.java:  
146) ~[na:1.6.0\_32]  
at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:78) ~[na:  
1.6.0\_32]  
at java.security.AccessController.doPrivileged(Native Method)  
~[na:1.6.0\_32]  
at sun.nio.ch.PipeImpl.(PipeImpl.java:122) ~[na:1.6.0\_32]

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 25, 2012, 11:09pm UTC](https://discuss.elastic.co/t/exception-when-closing-node/7849/2 "2012-05-25T23:09:18Z")

</div>

Maybe this is the reason?:  
[Oracle.com Outage](http://weblogs.java.net/blog/binod/archive/2006/12/glassfish_and_w.html).

On Thu, May 24, 2012 at 9:28 PM, Eric Jain [eric.jain@gmail.com](mailto:eric.jain@gmail.com) wrote:

> Since upgrading from 0.19.3 to 0.19.4, I get an exception whenever I  
> close an (embedded) elasticsearch instance:
> 
> client.admin().indices().prepareFlush("\_all").execute().actionGet();  
> client.close();  
> node.close();
> 
> [warn] n.c.DefaultChannelPipeline - An exception was thrown by an  
> exception handler.  
> org.elasticsearch.common.netty.channel.ChannelException: Failed to  
> create a selector.  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.start(AbstractNioWorker.java:  
> 162) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:  
> 314) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:  
> 38) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:  
> 298) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:  
> 38) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioChannelSink.execute(AbstractNioChannelSink.java:  
> 34) ~[elasticsearch-0.19.4.jar:na]  
> Caused by: java.io.IOException: Unable to establish loopback  
> connection  
> at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:106) ~[na:  
> 1.6.0\_32]  
> at java.security.AccessController.doPrivileged(Native Method)  
> ~[na:1.6.0\_32]  
> at sun.nio.ch.PipeImpl.(PipeImpl.java:122) ~[na:  
> 1.6.0\_32]  
> at  
> sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)  
> ~[na:1.6.0\_32]  
> at java.nio.channels.Pipe.open(Pipe.java:133) ~[na:1.6.0\_32]  
> at  
> sun.nio.ch.WindowsSelectorImpl.(WindowsSelectorImpl.java:104)  
> ~[na:1.6.0\_32]  
> Caused by: java.nio.channels.ClosedByInterruptException: null  
> at
> 
> java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:  
> 184) ~[na:1.6.0\_32]  
> at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:  
> 543) ~[na:1.6.0\_32]  
> at java.nio.channels.SocketChannel.open(SocketChannel.java:  
> 146) ~[na:1.6.0\_32]  
> at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:78) ~[na:  
> 1.6.0\_32]  
> at java.security.AccessController.doPrivileged(Native Method)  
> ~[na:1.6.0\_32]  
> at sun.nio.ch.PipeImpl.(PipeImpl.java:122) ~[na:  
> 1.6.0\_32]  
> [warn] n.c.DefaultChannelPipeline - An exception was thrown by an  
> exception handler.  
> org.elasticsearch.common.netty.channel.ChannelException: Failed to  
> create a selector.  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.start(AbstractNioWorker.java:  
> 162) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:  
> 314) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:  
> 38) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:  
> 298) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:  
> 38) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioChannelSink.execute(AbstractNioChannelSink.java:  
> 34) ~[elasticsearch-0.19.4.jar:na]  
> Caused by: java.io.IOException: Unable to establish loopback  
> connection  
> at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:106) ~[na:  
> 1.6.0\_32]  
> at java.security.AccessController.doPrivileged(Native Method)  
> ~[na:1.6.0\_32]  
> at sun.nio.ch.PipeImpl.(PipeImpl.java:122) ~[na:  
> 1.6.0\_32]  
> at  
> sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)  
> ~[na:1.6.0\_32]  
> at java.nio.channels.Pipe.open(Pipe.java:133) ~[na:1.6.0\_32]  
> at  
> sun.nio.ch.WindowsSelectorImpl.(WindowsSelectorImpl.java:104)  
> ~[na:1.6.0\_32]  
> Caused by: java.nio.channels.ClosedByInterruptException: null  
> at
> 
> java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:  
> 184) ~[na:1.6.0\_32]  
> at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:  
> 543) ~[na:1.6.0\_32]  
> at java.nio.channels.SocketChannel.open(SocketChannel.java:  
> 146) ~[na:1.6.0\_32]  
> at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:78) ~[na:  
> 1.6.0\_32]  
> at java.security.AccessController.doPrivileged(Native Method)  
> ~[na:1.6.0\_32]  
> at sun.nio.ch.PipeImpl.(PipeImpl.java:122) ~[na:  
> 1.6.0\_32]  
> [warn] n.c.DefaultChannelPipeline - An exception was thrown by an  
> exception handler.  
> org.elasticsearch.common.netty.channel.ChannelException: Failed to  
> create a selector.  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.start(AbstractNioWorker.java:  
> 162) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:  
> 314) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:  
> 38) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.executeInIoThread(AbstractNioWorker.java:  
> 298) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.NioWorker.executeInIoThread(NioWorker.java:  
> 38) ~[elasticsearch-0.19.4.jar:na]  
> at
> 
> org.elasticsearch.common.netty.channel.socket.nio.AbstractNioChannelSink.execute(AbstractNioChannelSink.java:  
> 34) ~[elasticsearch-0.19.4.jar:na]  
> Caused by: java.io.IOException: Unable to establish loopback  
> connection  
> at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:106) ~[na:  
> 1.6.0\_32]  
> at java.security.AccessController.doPrivileged(Native Method)  
> ~[na:1.6.0\_32]  
> at sun.nio.ch.PipeImpl.(PipeImpl.java:122) ~[na:  
> 1.6.0\_32]  
> at  
> sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)  
> ~[na:1.6.0\_32]  
> at java.nio.channels.Pipe.open(Pipe.java:133) ~[na:1.6.0\_32]  
> at  
> sun.nio.ch.WindowsSelectorImpl.(WindowsSelectorImpl.java:104)  
> ~[na:1.6.0\_32]  
> Caused by: java.nio.channels.ClosedByInterruptException: null  
> at
> 
> java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:  
> 184) ~[na:1.6.0\_32]  
> at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:  
> 543) ~[na:1.6.0\_32]  
> at java.nio.channels.SocketChannel.open(SocketChannel.java:  
> 146) ~[na:1.6.0\_32]  
> at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:78) ~[na:  
> 1.6.0\_32]  
> at java.security.AccessController.doPrivileged(Native Method)  
> ~[na:1.6.0\_32]  
> at sun.nio.ch.PipeImpl.(PipeImpl.java:122) ~[na:1.6.0\_32]

---

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [May 26, 2012, 12:39am UTC](https://discuss.elastic.co/t/exception-when-closing-node/7849/3 "2012-05-26T00:39:41Z")

</div>

On Fri, May 25, 2012 at 4:09 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Maybe this is the  
> reason?: [http://weblogs.java.net/blog/binod/archive/2006/12/glassfish\_and\_w.html](http://weblogs.java.net/blog/binod/archive/2006/12/glassfish_and_w.html).

I can't reproduce the error after clearing out the data dir. But if I  
do see this error again, I'll check if the firewall has anything to do  
with it. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:26am UTC](https://discuss.elastic.co/t/exception-when-closing-node/7849/4 "2017-07-06T03:26:51Z")

</div>


