# Exception on logstash when closing filebeat

**URL:** https://discuss.elastic.co/t/exception-on-logstash-when-closing-filebeat/227142
**Category:** Logstash
**Created:** [April 8, 2020, 1:56pm UTC](https://discuss.elastic.co/t/exception-on-logstash-when-closing-filebeat/227142 "2020-04-08T13:56:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![billymerendina](https://avatars.discourse-cdn.com/v4/letter/b/71e660/32.png) [@billymerendina](https://discuss.elastic.co/u/billymerendina)
#### Post date: [April 8, 2020, 1:56pm UTC](https://discuss.elastic.co/t/exception-on-logstash-when-closing-filebeat/227142/1 "2020-04-08T13:56:52Z")

</div>

Hi everybody,

I'm working with Elasticsearh, kibana, filebeat and logstash 7.6.2 on windows pc.  
Everythings seems to be right.  
But I see somethng strange when i kill (ctrl + c) the filebeat process (I don 't use it as service).  
When I kill the filebeat process, logstash notifies this exception:

```auto
[2020-04-08T04:50:04,395][INFO][org.logstash.beats.BeatsHandler][main] [local: 0.0.0.0:5044, remote: 10.1.1.1:49628] Handling exception: An existing connection was forcibly closed by the remote host
			[2020-04-08T04:50:04,395][WARN][io.netty.channel.DefaultChannelPipeline][main] An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
			java.io.IOException: An existing connection was forcibly closed by the remote host
					at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[?:?]
					at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) ~[?:?]
					at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276) ~[?:?]
					at sun.nio.ch.IOUtil.read(IOUtil.java:233) ~[?:?]
					at sun.nio.ch.IOUtil.read(IOUtil.java:223) ~[?:?]
					at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358) ~[?:?]
					at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
					at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1128) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
					at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
					at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
					at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
					at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
					at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
					at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458) [netty-all-4.1.30.Final.jar:4.1.30.Final]
					at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897) [netty-all-4.1.30.Final.jar:4.1.30.Final]
					at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.30.Final.jar:4.1.30.Final]
					at java.lang.Thread.run(Thread.java:834) [?:?]

```

Is there a way to close filebeat process gracefully?  
I'm my filebeat.yml I have this properties:

```auto
ignore_older: 10m
 close_inactive: 5m

```

But it does not resolve my problem.  
Thank you in advance,  
Regards.  
Alessandro

---

<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: [May 6, 2020, 1:56pm UTC](https://discuss.elastic.co/t/exception-on-logstash-when-closing-filebeat/227142/2 "2020-05-06T13:56:59Z")

</div>

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