[rabbitmq-discuss] py-amqplib doesn't like Rabbit user refusals

Jason J. W. Williams jasonjwwilliams at gmail.com
Mon Feb 2 22:32:58 GMT 2009


Hi,

It appears that py-amqplib really doesn't like it when you try to log
on to a vhost with a user that lacks authorization. Instead of
specific exception, a struct.error exception is raised with this
traceback:

2009-02-02 22:13:17+0000 [-] Traceback (most recent call last):
2009-02-02 22:13:17+0000 [-]   File "zzzz.py", line 377, in yyyy
2009-02-02 22:13:17+0000 [-]     self.mq_connect()
2009-02-02 22:13:17+0000 [-]   File "zzzz.py", line 145, in mq_connect
2009-02-02 22:13:17+0000 [-]     connect_timeout=5)
2009-02-02 22:13:17+0000 [-]   File
"/usr/lib64/python2.5/site-packages/amqplib/client_0_8.py", line 298,
in __init__
2009-02-02 22:13:17+0000 [-]     (10, 30), # tune
2009-02-02 22:13:17+0000 [-]   File
"/usr/lib64/python2.5/site-packages/amqplib/client_0_8.py", line 183,
in wait
2009-02-02 22:13:17+0000 [-]     frame_type, payload = self._next_frame()
2009-02-02 22:13:17+0000 [-]   File
"/usr/lib64/python2.5/site-packages/amqplib/client_0_8.py", line 123,
in _next_frame
2009-02-02 22:13:17+0000 [-]     return
self.connection._wait_channel(self.channel_id)
2009-02-02 22:13:17+0000 [-]   File
"/usr/lib64/python2.5/site-packages/amqplib/client_0_8.py", line 414,
in _wait_channel
2009-02-02 22:13:17+0000 [-]     frame_type, frame_channel, payload =
self._wait_frame()
2009-02-02 22:13:17+0000 [-]   File
"/usr/lib64/python2.5/site-packages/amqplib/client_0_8.py", line 395,
in _wait_frame
2009-02-02 22:13:17+0000 [-]     frame_type = self.input.read_octet()
2009-02-02 22:13:17+0000 [-]   File
"/usr/lib64/python2.5/site-packages/amqplib/util_0_8.py", line 96, in
read_octet
2009-02-02 22:13:17+0000 [-]     return unpack('B', self.input.read(1))[0]
2009-02-02 22:13:17+0000 [-]   File "/usr/lib64/python2.5/struct.py",
line 87, in unpack
2009-02-02 22:13:17+0000 [-]     return o.unpack(s)
2009-02-02 22:13:17+0000 [-] error: unpack requires a string argument
of length 1


The RabbitMQ side reports a rather sane error:

{channel0_error,starting,
                {amqp,access_refused,"login refused for user 'argus'",
                      'connection.start_ok'}}


Is py-amqplib just not set up to cleanly handle user refusals, or is
this an unknown bug?

-J




More information about the rabbitmq-discuss mailing list