Skip to content
This repository has been archived by the owner on Feb 21, 2025. It is now read-only.

When using vhost getting 403 #55

Open
amorimdev opened this issue Jul 12, 2017 · 4 comments
Open

When using vhost getting 403 #55

amorimdev opened this issue Jul 12, 2017 · 4 comments

Comments

@amorimdev
Copy link

amorimdev commented Jul 12, 2017

Any vhost that I put in the configuration file other than "/", sample "/test", throws forbidden error:
2017/07/12 16:13:56 Connecting RabbitMQ... 2017/07/12 16:13:56 Failed creating consumer: Failed connecting RabbitMQ: Exception (403) Reason: "no access to this vhost"

@ricbra
Copy link
Owner

ricbra commented Jul 13, 2017

Seems like a configuration issue. Did you create a vhost and user? Is the consumer configured correctly?

@amorimdev
Copy link
Author

amorimdev commented Jul 13, 2017

Yes, i create vhost and user, works perfectly in symfony posting messages.
The configuration is the same as I'm using in my parameters.yml for RabbitMqBundle.
I released the user access to "/", when I change the setting to vhost "/" it works, but if put vhost for sample "/test-or-any" its not works

@ozzmaster
Copy link

ozzmaster commented Sep 28, 2017

My solution was to add an extra / to the start of the vhost in the conf file:

[rabbitmq]
host = localhost
username = guest
password = ****
vhost=//host_name
port=5672
queue=queue_name
compression=Off

@mz-jy
Copy link

mz-jy commented Feb 13, 2019

I had the similar issue; however, it turned out that for the name of the vhost, I need to add an addition / to connect it. For example, if i created a vhost '/test', I need to connect to amqp://guest:guest@localhost:5672//test for this to work. So, in my point of view, the string /test is seen integratedly as the name of the vhost, and what happened to me was just the misuse of the name of the vhost.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants