closing AMQP connection : client unexpectedly closed TCP connection

3,231 views
Skip to first unread message

Dharma Raj

unread,
Jan 29, 2019, 6:30:09 AM1/29/19
to rabbitmq-users
Hi, 

I am using the RabbitMQ 3.6.12 version with java 8 client . I am getting frequent exeption in the RabbitMQ log and my client is getting exited to consume the message. 

Kindly find the logs on the Rabbit MQ

=WARNING REPORT==== 29-DEC-2018::16:02:38 ===
closing AMQP connection <0.8979.3> (127.0.0.1:57065 -> 127.0.0.1:5672, vhost: '/', user: 'guest'):
client unexpectedly closed TCP connection

Kindly find the logs on the Java Client

[com.rabbitmq.client.impl.ForgivingExceptionHandler] (AMQP Connection 127.0.0.1:5672)
An unexpected connection driver error occured: java.net.SocketException: Unrecognized Windows Sockets error: 0: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:288)
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:91)
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:164)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:580)
at java.lang.Thread.run(Thread.java:748)


Luke Bakken

unread,
Jan 29, 2019, 9:42:18 AM1/29/19
to rabbitmq-users
Hi Dharma,

Most likely, something is causing the TCP connection to fail, though it's very strange for a localhost-only connection to have this happen.

If this is happening frequently, you can use a tool like Wireshark to do a traffic capture on port 5672 and see exactly what is happening to the TCP stream.

I also just searched Google with the text java.net.SocketException "Windows Sockets" "recv failed"

This response may be useful, if you have IPv4 and IPv6 enabled on the server running your Java application: https://stackoverflow.com/a/45804491

Thanks,
Luke

Michael Klishin

unread,
Jan 29, 2019, 12:20:08 PM1/29/19
to rabbitm...@googlegroups.com
The "client unexpectedly closed TCP connection" part is covered in [1].

In the client log you see a failing socket read with "Unrecognized Windows Sockets error: 0: recv failed". The latter has
a number of threads that recommend forcing the JVM to use IPv4 without providing any evidence. You can try it,
although it should only be treated as a hack (unless IPv6 is really expected to not be available in your environment).


--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Dharma Raj

unread,
Jan 30, 2019, 12:09:31 AM1/30/19
to rabbitm...@googlegroups.com
Hi, 

Thanks for the help. But I have done with your recommendation but still i am getting this same error. 

Thanks
Dharmaraj.G

You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/DyKDiQwII8s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-user...@googlegroups.com.

Dharma Raj

unread,
Jan 30, 2019, 2:27:52 AM1/30/19
to rabbitm...@googlegroups.com
Hi 

This exception I am getting when i have enabled the ToplogyRecovery option. If i disable then I am not seeing this error.  Can you help me is this behaviour? 

Thanks
DHarmaraj. G

Luke Bakken

unread,
Jan 30, 2019, 9:41:33 AM1/30/19
to rabbitmq-users
Hello,

We can't help you without more information, like code to reproduce this issue and/or a Wireshark trace on port 5672 when it happens.

Thanks,
Luke

On Tuesday, January 29, 2019 at 11:27:52 PM UTC-8, Dharma Raj wrote:
Hi 

This exception I am getting when i have enabled the ToplogyRecovery option. If i disable then I am not seeing this error.  Can you help me is this behaviour? 

Thanks
DHarmaraj. G

Reply all
Reply to author
Forward
0 new messages