[rabbitmq-discuss] how to detect bad username/password in 0.9.5?

Gavin M. Roy gmr at myyearbook.com
Mon May 9 16:12:40 BST 2011

In trying to track this down with RabbitMQ 2.4.1 and Pika 0.9.6pre0 I am not seeing any reply back from Rabbit after a Connection.StartOk is sent, the socket just closes.

Is this expected behavior from the broker perspective? I imagine since the connection is never negotiating doing a Connection.Close from the server is not appropriate. Any suggestions on how to raise this as an Exception since it seems to be an implied behavior that broker disconnects if the mechanism or response values are incorrect?

The error logs do show the error as expected.

=ERROR REPORT==== 9-May-2011::11:05:32 ===
exception on TCP connection <0.6098.0> from
"PLAIN login refused: user 'gmr' - invalid credentials",

=INFO REPORT==== 9-May-2011::11:05:32 ===
closing TCP connection <0.6098.0> from

On Thursday, May 5, 2011 at 11:17 AM, Brandon Craig Rhodes wrote:
When a error occurs while connecting in Pika 0.9.5, I have to go log on
> to my RabbitMQ server and look at its logs to discover what happened -
> the IOLoop in the local program simply returns after three seconds and
> my next piece of code breaks because the `on_open_callback` callback
> that I am passing to my `SelectConnection` never gets called when the
> username and password are wrong.
> How am I supposed to intercept this condition so that I can return an
> error message to my user? I tried registering a callback with the
> `connection.add_on_close_callback()` method but, sensibly enough, it
> never gets called because this is not really a connection-close, but a
> connection not getting established in the first place. I have looked
> around for some sort of a `connection.add_on_error_callback()` or some
> similar sort of facility, but cannot find one.
> How do I catch and handle asynchronous errors?
> Thanks for ANY help that you guys can offer - and thanks, Gavin, for
> writing such an important part of the modern Python ecosystem!
> -- 
> Brandon Craig Rhodes brandon at rhodesmill.org http://rhodesmill.org/brandon
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110509/6b5d21ea/attachment.htm>

More information about the rabbitmq-discuss mailing list