ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. in Vertx RabbitMQ Client

7,712 views
Skip to first unread message

dumdumdu...@gmail.com

unread,
Nov 2, 2017, 4:14:55 PM11/2/17
to rabbitmq-users
Hi,

I'm using Vertx RabbitMQ Client, which internally uses RabbitMQ Client (com.rabbitmq.client.impl.AMQConnection).

I'm trying to deploy something in Prod for first time and getting Error - 

com.rabbitmq.client.AuthenticationFailureException:  For details see the broker logfile.

       at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:338) ~[websocket-server-1.0-SNAPSHOT-fat.jar:?]

       at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:52) ~[websocket-server-1.0-SNAPSHOT-fat.jar:?]

       at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:108) ~[websocket-server-1.0-SNAPSHOT-fat.jar:?]

       at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:816) ~[websocket-server-1.0-SNAPSHOT-fat.jar:?]

       at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:778) ~[websocket-server-1.0-SNAPSHOT-fat.jar:?]

       at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:868) ~[websocket-server-1.0-SNAPSHOT-fat.jar:?]

.
.
.



To be clear, there is no issue with credentials or other config values. I can publish to exchange and get messages from Queue using RabbitMQAdmin for same RabbitMQ Cluster just fine. However, when I try to run Java Code, I'm getting this error.

Going  by Code of com.rabbitmq.client.impl.AMQConnection, it seems this error "ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN." is returned by RabbitMQ.

Any ideas as to why this can happen?


dumdumdu...@gmail.com

unread,
Nov 2, 2017, 4:19:18 PM11/2/17
to rabbitmq-users
Just to be sure, I'm using same Username And Password while trying to connect from Java Code.

Michael Klishin

unread,
Nov 2, 2017, 7:44:51 PM11/2/17
to rabbitm...@googlegroups.com
We cannot suggest much with the amount of information provided.

See server logs, check the credentials, give `rabbitmqctl authenticate_user` a try [1] and make sure that
the user has been granted permissions for accessing the target vhost.


--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Michael Klishin

unread,
Nov 2, 2017, 7:46:00 PM11/2/17
to rabbitm...@googlegroups.com
And, of course, remember that user "guest" cannot connect from remote hosts,

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

dumdumdu...@gmail.com

unread,
Nov 2, 2017, 8:49:07 PM11/2/17
to rabbitmq-users
Hi both,

Thanks for the replies.

The Username and passsword are correct.

User is not "guest", and the user has access to virtual host.

Following commands work with all the values substituted - 

./rabbitmqadmin --host=<host> --vhost='/' --username=<user> --password=<password>  publish exchange=<exchange> routing_key="" payload="hello, world"



./rabbitmqadmin --host=<host> --vhost='/' --username=<user> --password=<password>  get queue=<queue_name> requeue=false



But the Java client is throwing Exception.
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

Michael Klishin

unread,
Nov 2, 2017, 9:24:52 PM11/2/17
to rabbitm...@googlegroups.com
rabbitmqadmin does not use the same API as the Java client.

Please verify that the credentials are correct using `rabbitmqctl authenticate_user` as suggested above.
Then check that user's permission.

If that doesn't lead you to a solution, please do post server logs around the time of connection attempt
and consider posting your actual code. Please help others help you by following the advice provided.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages