Closed yuha0 closed 7 years ago
If you can provide a trace of the conversation with either DEBUG logs from rabbitpy or with tcpdump, I can verify that is the case. My guess is that RabbitMQ didn't allow your user to connect to the VHost and it returned AMQPNotAllowed.
You are right. The DEBUG message says access refused. The root cause was that the vhost "testtttt" did not exist. Here's the log:
DEBUG:rabbitpy.base:Connection setting state to 'Opening'
DEBUG:rabbitpy.base:IO setting state to 'Opening'
DEBUG:rabbitpy.events:Waiting for 1 seconds on event: Socket Connected
DEBUG:rabbitpy.io:Connecting to ('10.211.55.6', 5672)
DEBUG:rabbitpy.base:IO setting state to 'Open'
DEBUG:rabbitpy.io:Socket connected
DEBUG:rabbitpy.io:Returning PollPoller
DEBUG:rabbitpy.connection:Adding channel 0 to io
DEBUG:rabbitpy.base:Channel0 setting state to 'Opening'
DEBUG:rabbitpy.base:Writing frame: ProtocolHeader
DEBUG:rabbitpy.channel0:Received frame: 'Connection.Start'
DEBUG:rabbitpy.channel0:Server information: 'Licensed under the MPL. See http://www.rabbitmq.com/'
DEBUG:rabbitpy.channel0:Server product: 'RabbitMQ'
DEBUG:rabbitpy.channel0:Server copyright: 'Copyright (C) 2007-2016 Pivotal Software, Inc.'
DEBUG:rabbitpy.channel0:Server supports exchange_exchange_bindings: True
DEBUG:rabbitpy.channel0:Server supports connection.blocked: True
DEBUG:rabbitpy.channel0:Server supports authentication_failure_close: True
DEBUG:rabbitpy.channel0:Server supports direct_reply_to: True
DEBUG:rabbitpy.channel0:Server supports basic.nack: True
DEBUG:rabbitpy.channel0:Server supports per_consumer_qos: True
DEBUG:rabbitpy.channel0:Server supports consumer_priorities: True
DEBUG:rabbitpy.channel0:Server supports consumer_cancel_notify: True
DEBUG:rabbitpy.channel0:Server supports publisher_confirms: True
DEBUG:rabbitpy.channel0:Server cluster_name: 'rabbit@ubuntu1404'
DEBUG:rabbitpy.channel0:Server platform: 'Erlang/OTP'
DEBUG:rabbitpy.channel0:Server version: '3.6.1'
DEBUG:rabbitpy.base:Writing frame: Connection.StartOk
DEBUG:rabbitpy.channel0:Received frame: 'Connection.Tune'
DEBUG:rabbitpy.channel0:Tuning, client: 300
DEBUG:rabbitpy.channel0:Started a heartbeat timer that will fire in 90 sec
DEBUG:rabbitpy.base:Writing frame: Connection.TuneOk
DEBUG:rabbitpy.base:Writing frame: Connection.Open
DEBUG:rabbitpy.channel0:Received frame: 'Connection.Close'
WARNING:rabbitpy.channel0:RabbitMQ closed the connection (530): NOT_ALLOWED - access to vhost 'testtttt' refused for user 'admin'
DEBUG:rabbitpy.base:Channel0 setting state to 'Closed'
DEBUG:rabbitpy.io:Exiting due to closed socket
DEBUG:rabbitpy.io:Exiting IOLoop.run
DEBUG:rabbitpy.io:Exiting IO.run
DEBUG:rabbitpy.base:IO setting state to 'Closing'
DEBUG:rabbitpy.base:IO setting state to 'Closed'
Error: NOT_ALLOWED - access to vhost 'testtttt' refused for user 'admin'
According to the documentation, I was expecting rabbitpy.exceptions.AMQPInvalidPath
because there's no vhost called "testtttt".
That error is what's coming back from RabbitMQ -- I'd send an email to the mailing list to see what they have to say on this issue.
When I was making a new connection to broker with an unknown vhost,
rabbitpy.exceptions.AMQPNotAllowed
was raised instead ofrabbitpy.exceptions.AMQPInvalidPath
.My broker version is 'RabbitMQ 3.6.1'.