20
votes

I have tried to use Rabbitmq server for some reason the connection closes abruptly even though I passed the correct username and password.

Rabbitmq server is running on port 5672 and telneting to my server at port 5672 says its running fine.

I have installed rabbitmq server in CentOS and my rabbitmq server log are as follows:

=INFO REPORT==== 19-Dec-2012::06:25:44 ===
accepted TCP connection on [::]:5672 from <host>:42048

=INFO REPORT==== 19-Dec-2012::06:25:44 ===
starting TCP connection <0.357.0> from <host>:42048

=WARNING REPORT==== 19-Dec-2012::06:25:44 ===
exception on TCP connection <0.357.0> from <host>:42048
connection_closed_abruptly

=INFO REPORT==== 19-Dec-2012::06:25:44 ===
closing TCP connection <0.357.0> from <host>:42048

What might be the possible reasons for this to happen.

Thanks

2
I'm writing python 2.6 code that uses pika.BlockingConnection and each time I call the .close() on it, I get the warning. I also noticed that since I have it as a loop, that it increases the port number it listens to next. I found moving my connection declaration and closing out of my loop reduced the number of warnings, but didn't really solve the underlying issue, but I avoid disk spaces issues from the log file. I also tried the .close() with the code and string to have the same error. I also am running on CentOS 5.x (think I got the same problem with CentOS 6.x too)James Oravec

2 Answers

19
votes

connection_closed_abruptly means the client closed the TCP connection without going through the proper AMQP connection termination process.

Is your rabbit server behind a load balancer? A common cause for connections being abruptly closed as soon as they're started is a TCP load balancer's heartbeat. If this is the case you should see these messages at very regular intervals, and the generally accepted practice seems to be to ignore them. To avoid log file buildup you could also consider raising the log level to "error".

On the other hand, if your client connects to the rabbitmq server directly, this probably means your client does not close the connection in an AMQP-approved way. You could try a different client to confirm whether this is the case.

Btw, telnetting to your server is likely to cause abrupt closings too. :)

0
votes
  1. Check your connection limit

  2. Your connection is time short, there is usually caused by your client improper use