Rabbitmq - Plain Login refused

6,399 views
Skip to first unread message

muralidharan selvaraj

unread,
Sep 3, 2015, 12:59:10 PM9/3/15
to rabbitmq-users
I need to listen for a particular message from a rabbit queue.

For eg: JSON response in queue notifications.info is as follows:


   
{"event_type": "compute.instance.create.end",
     
"timestamp": "2012-03-12 17:00:24.156710",
     
"message_id": "00004e00-8da5-4c39-8ffb-c94ed0b5278c",
     
"priority": "INFO",
     
"publisher_id": "compute.compute-1-5-6-7",
     
.
     
.
     
.
Enter code here...




      
So this is an JSON response or message which I am getting in a Queue notifications.info.

I need to listen synchronously for the particular message and also needs to perform certain operations after that.

Here I have elaborated in detail.This is what I have done so far.

Actually my aim is to get some notification on new instance creation.

So that I have set up the notifications.info to receive message during instance creation.

Now I have framed the basic script which is as follows(Using Rabbitmq site guide):

   
 #!/usr/bin/env python
   
import pika
   
import sys
   
    connection
= pika.BlockingConnection(pika.ConnectionParameters(
            host
='localhost'))
    channel
= connection.channel()
   
    channel
.exchange_declare(exchange='nova',
                             type
='direct')
   
    result
= channel.queue_declare(exclusive=True)
    queue_name
= result.method.queue
   
    severities
= sys.argv[1:]
   
if not severities:
       
print >> sys.stderr, "Usage: %s [info] [warning] [error]" % \
                             
(sys.argv[0],)
        sys
.exit(1)
   
   
for severity in severities:
        channel
.queue_bind(exchange='nova',
                           queue
=queue_name,
                           routing_key
=severity)
   
   
print ' [*] Waiting for logs. To exit press CTRL+C'
   
   
def callback(ch, method, properties, body):
       
print " [x] %r:%r" % (method.routing_key, body,)
   
    channel
.basic_consume(callback,
                          queue
=queue_name,
                          no_ack
=True)
   
    channel
.start_consuming()





There is more modifications were needs to be done in scipts.

But now issue is that while executing the script I am getting error which is as follows:

 
   Traceback (most recent call last):
     
File "new1.py", line 6, in <module>
        host
='localhost'))
     
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection                                                                                        .py", line 339, in __init__
       
self._process_io_for_connection_setup()
     
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection                                                                                        .py", line 374, in _process_io_for_connection_setup
       
self._open_error_result.is_ready)
     
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection                                                                                        .py", line 410, in _flush_output
       
self._impl.ioloop.poll()
     
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/select_connection.p                                                                                        y", line 602, in poll
       
self._process_fd_events(fd_event_map, write_only)
     
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/select_connection.p                                                                                        y", line 443, in _process_fd_events
        handler
(fileno, events, write_only=write_only)
     
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py"                                                                                        , line 364, in _handle_events
       
self._handle_read()
     
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py"                                                                                        , line 407, in _handle_read
       
return self._handle_error(error)
     
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py"                                                                                        , line 338, in _handle_error
       
self._handle_disconnect()
     
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py"                                                                                        , line 288, in _handle_disconnect
       
self._adapter_disconnect()
     
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/select_connection.p                                                                                        y", line 95, in _adapter_disconnect
       
super(SelectConnection, self)._adapter_disconnect()
     
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py"                                                                                        , line 154, in _adapter_disconnect
       
self._check_state_on_disconnect()
     
File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py"                                                                                        , line 173, in _check_state_on_disconnect
       
raise exceptions.ProbableAuthenticationError
    pika
.exceptions.ProbableAuthenticationError



Log is showing the error is as follows:

    {handshake_error,starting,0,
                     
{amqp_error,access_refused,
                                 
"PLAIN login refused: user 'guest' - invalid credentials",
                                 
'connection.start_ok'}}


So some one let me know what is needs to be done here to fix this.

Gavin M. Roy

unread,
Sep 3, 2015, 1:01:28 PM9/3/15
to rabbitm...@googlegroups.com
On Thu, Sep 3, 2015 at 12:59 PM, muralidharan selvaraj <muralise...@gmail.com> wrote:

So some one let me know what is needs to be done here to fix this.


You'll probably want to add a user for your application instead of using guest/guest.

Gavin 


 

Michael Klishin

unread,
Sep 3, 2015, 1:03:40 PM9/3/15
to rabbitm...@googlegroups.com, muralidharan selvaraj
 On 3 Sep 2015 at 19:59:12, muralidharan selvaraj (muralise...@gmail.com) wrote:
> Log is showing the error is as follows:
>
> {handshake_error,starting,0,
> {amqp_error,access_refused,
> "PLAIN login refused: user 'guest' - invalid credentials",
> 'connection.start_ok'}}
>
>
> So some one let me know what is needs to be done here to fix this.

There are 3 possibilities:

 * The user guest does not exist
 * It doesn’t have access to the vhost you are trying to open a connection to
 * You try connecting from a host other than localhost

Search for “localhost” on http://www.rabbitmq.com/access-control.html
and see rabbitmqctl man page.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


muralidharan selvaraj

unread,
Sep 3, 2015, 1:21:30 PM9/3/15
to Michael Klishin, rabbitm...@googlegroups.com
I can be able to login to rabbitmq front-end using guest user, I guess there is no issues with user.

As well as I am trying to connect from localhost itself.

I guess user guest is having access to vhost , because I can get the message queue in front end

Gavin M. Roy

unread,
Sep 3, 2015, 1:50:16 PM9/3/15
to rabbitm...@googlegroups.com, Michael Klishin
On Thu, Sep 3, 2015 at 1:21 PM, muralidharan selvaraj <muralise...@gmail.com> wrote:
I can be able to login to rabbitmq front-end using guest user, I guess there is no issues with user.

As well as I am trying to connect from localhost itself.

I guess user guest is having access to vhost , because I can get the message queue in front end

Then you have a typo or some related issue. Pika is detecting its disconnected when trying to authenticate. RabbitMQ is telling you it's disconnecting you due to an authentication error. If I'm not mistaken the log will also show you the IP address the client disconnected you from.

FYI: guest/guest can only authenticate by default to 127.0.0.1 - not the local ip address of the machine, but literally localhost.

 

muralidharan selvaraj

unread,
Sep 4, 2015, 3:02:55 AM9/4/15
to rabbitm...@googlegroups.com, Michael Klishin
full detailed log is as follows:

=INFO REPORT==== 4-Sep-2015::00:02:14 ===
accepting AMQP connection <0.27882.5> (127.0.0.1:49282 -> 127.0.0.1:5672)

=ERROR REPORT==== 4-Sep-2015::00:02:17 ===
closing AMQP connection <0.27882.5> (127.0.0.1:49282 -> 127.0.0.1:5672):

{handshake_error,starting,0,
                 {amqp_error,access_refused,
                             "PLAIN login refused: user 'guest' - invalid credentials",
                             'connection.start_ok'}}

--
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/AKv7KRp7qwg/unsubscribe.
To unsubscribe from this group and all its topics, 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.

muralidharan selvaraj

unread,
Sep 4, 2015, 6:42:26 AM9/4/15
to rabbitm...@googlegroups.com, Michael Klishin
Thank you for assistance,

Actually I found the issue and fixed it.

Actually there was password conflict that is the reason why it results in such an error.

When I am configuring new password rather than default one for rabbitmq it results in an error,

So I tried using the default password 'guest' itself for 'guest' user.

Then the issue is fixed here.


Michael Klishin

unread,
Sep 4, 2015, 6:53:26 AM9/4/15
to rabbitm...@googlegroups.com, muralidharan selvaraj
On 4 Sep 2015 at 13:42:24, muralidharan selvaraj (muralise...@gmail.com) wrote:
> Thank you for assistance,
>
> Actually I found the issue and fixed it.
>
> Actually there was password conflict that is the reason why it
> results in such an error.
>
> When I am configuring new password rather than default one for
> rabbitmq it results in an error,
>
>
> So I tried using the default password 'guest' itself for 'guest'
> user.
>
>
> Then the issue is fixed here.

FTR, we highly recommend using a separate user with a secure,
generated password :
http://rabbitmq.com/production-checklist.html
Reply all
Reply to author
Forward
0 new messages