# Failed to publish events caused by: read tcp 150.xxx.xxx.xxx:54336-\>150.xxx.xxx.xxx:5044: read: connection reset by peer

**URL:** <https://discuss.elastic.co/t/failed-to-publish-events-caused-by-read-tcp-150-xxx-xxx-xxx-54336-150-xxx-xxx-xxx-read-connection-reset-by-peer/219439>\
**Category:** Logstash\
**Created:** [February 14, 2020, 7:21pm UTC](https://discuss.elastic.co/t/failed-to-publish-events-caused-by-read-tcp-150-xxx-xxx-xxx-54336-150-xxx-xxx-xxx-read-connection-reset-by-peer/219439 "2020-02-14T19:21:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Heber\_Leandro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/heber_leandro/32/62745_2.png) [@Heber\_Leandro](https://discuss.elastic.co/u/Heber_Leandro)\
**Post date:** [February 14, 2020, 7:21pm UTC](https://discuss.elastic.co/t/failed-to-publish-events-caused-by-read-tcp-150-xxx-xxx-xxx-54336-150-xxx-xxx-xxx-read-connection-reset-by-peer/219439/1 "2020-02-14T19:21:50Z")

</div>

i'm having a problem like this: [Logstash on K8S spammed with Connection Reset By Peer](https://discuss.elastic.co/t/logstash-on-k8s-spammed-with-connection-reset-by-peer/183815)

does anyone know how to solve?

---

<div class="post-metadata">

**Author:** ![Heber\_Leandro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/heber_leandro/32/62745_2.png) [@Heber\_Leandro](https://discuss.elastic.co/u/Heber_Leandro)\
**Post date:** [February 17, 2020, 6:36pm UTC](https://discuss.elastic.co/t/failed-to-publish-events-caused-by-read-tcp-150-xxx-xxx-xxx-54336-150-xxx-xxx-xxx-read-connection-reset-by-peer/219439/3 "2020-02-17T18:36:46Z")

</div>

My LS logs

```auto
[2020-02-17T15:27:20,062][INFO][org.logstash.beats.BeatsHandler][main] [local: 0.0.0.0:5044, remote: undefined] Handling exception: Connection reset by peer
[2020-02-17T15:27:20,074][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: Connection reset by peer
	at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[?:?]
	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) [?:?]

```

My FB logs

```
|2020-02-17T15:27:51.572-0300|INFO|pipeline/output.go:95|Connecting to backoff(async(tcp://150.161.11.114:5044))|
|---|---|---|---|
|2020-02-17T15:27:51.574-0300|INFO|pipeline/output.go:105|Connection to backoff(async(tcp://150.161.11.114:5044)) established|
|2020-02-17T15:27:51.577-0300|ERROR|logstash/async.go:256|Failed to publish events caused by: read tcp 150.161.0.4:38711->150.161.11.114:5044: read: connection reset by peer|
|2020-02-17T15:27:51.581-0300|ERROR|logstash/async.go:256|Failed to publish events caused by: client is not connected|
```

---

<div class="post-metadata">

**Author:** ![Heber\_Leandro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/heber_leandro/32/62745_2.png) [@Heber\_Leandro](https://discuss.elastic.co/u/Heber_Leandro)\
**Post date:** [February 18, 2020, 5:49pm UTC](https://discuss.elastic.co/t/failed-to-publish-events-caused-by-read-tcp-150-xxx-xxx-xxx-54336-150-xxx-xxx-xxx-read-connection-reset-by-peer/219439/4 "2020-02-18T17:49:59Z")

</div>

There was some blocking on the firewall, because I was trying to communicate on different subnets, which I couldn't identify.  
**Tried on the same subnet worked normally.**

---

<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:** [March 17, 2020, 5:50pm UTC](https://discuss.elastic.co/t/failed-to-publish-events-caused-by-read-tcp-150-xxx-xxx-xxx-54336-150-xxx-xxx-xxx-read-connection-reset-by-peer/219439/5 "2020-03-17T17:50:07Z")

</div>

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