[rabbitmq-discuss] Behaviour when connecting with invalid credentials

David MacIver david at drmaciver.com
Thu May 6 17:25:01 BST 2010

(Currently using the 1.7.2 server and the current default branch of
mercurial for the Java client)

If you use the Java client and try to connect to the rabbit server
with bad credentials (e.g. dodgy password, no permissions for the
vhost, user doesn't exist) you'll see the following:

com.rabbitmq.client.ShutdownSignalException: connection error; reason:
	at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:81)
	at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:47)
	at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:336)
	at com.rabbitmq.client.impl.AMQChannel.rpc(AMQChannel.java:209)
	at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:133)
	at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:302)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:375)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:420)
	at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:273)
	at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:118)
	at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:133)
	at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:413)
	at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.j...

I'm not quite sure if this is correct behaviour on the part of the
broker - it's not clear to me what the defined behaviour when
rejecting the credentials of a connecting user, but the actual
behaviour just seems to be to close the connection with prejudice:

=ERROR REPORT==== 6-May-2010::17:13:56 ===
exception on TCP connection <0.652.0> from
                            "login refused for user 'hello world'",

=INFO REPORT==== 6-May-2010::17:13:56 ===
closing TCP connection <0.652.0> from

if this is intended behaviour then it would be nice if the Java client
were to be a little more informative rather than failing noisily here.

I first noticed this because Bunny (a ruby AMQP client I'm doing some
work with/on) has essentially the same behaviour and falls over with
an unexpected nil on having its credentials rejected.  Other AMQP
clients presumably have similar issues.

So, what's up here?

More information about the rabbitmq-discuss mailing list