简体   繁体   中英

RabbitMQ Error 530 vhost not found with pika

I am trying to connect to a remote rabbitmq server. I have the correct credentials and vhost exists on the remove server, but I cannot connect. I get the error

pika.exceptions.ProbableAccessDeniedError: (530, 'NOT_ALLOWED - vhost test_vhost not found')

I have struggled with this for a while but I can't seem to get what the problem is.

I figured it out. On my local machine I am using rabbitmq version 3.5.7 while on the remote rabbitmq is on version 3.7.0

I had been declaring my vhost without a slash '/' on 3.5.2 and it has been working well but I realized that adding a slash before declaring the vhost worked on version 3.7.0 . So now I use /test_vhost instead of just test_vhost

For me, before:

AMQP_URL = 'amqp://guest:guest@localhost:5672/hostname'

after:

AMQP_URL = 'amqp://guest:guest@localhost:5672'

it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM