n8n
n8n copied to clipboard
Rabbit MQ QueueDeclare for user with no "queue.declare" permissions
Describe the bug The RabbitMQ Trigger node throws an error when using a user with no "queue.declare" permissions, cause the implementation calls "assertQueue" before connecting to the queue.
This is the error I get:
ERROR: Operation failed: QueueDeclare; 403 (ACCESS-REFUSED) with message "ACCESS_REFUSED - access to queue 'xxx-test' in vhost 'staging' refused for user 'n8n'"
To Reproduce Steps to reproduce the behavior: 1 - Configure your RMQ user without "queue.declare" permission 2 - Create the queue in RMQ and give user READ access 3 - Configure you RMQ Trigger Node with the created queue 4 - Run the worflow 5 - Expect the error above
Expected behavior I would expect an option to enable/disable the assertion of queues (and possibly exchanges) for such cases where n8n user has granted only "read" permissions.
Environment (please complete the following information):
- OS: Ubuntu Linux 22.04
- n8n Version 1.17.1
- Node.js Version 18.16.0
- Database system SQLite
- Operation mode main
Hey @ascariandrea,
This is an interesting one and I am not sure if this is a bug or a feature request, We use Assert to make sure the queue is there but I can also see why you wouldn't want to auto create queues.
Do you believe this is a bug or a feature request?
Thank you @Joffcom, I actually think this could be a feature request (and applied to both exchange and queue definitions).
If you want me, I can open a PR in the next days 👍🏽
Hey @ascariandrea,
If you wanted to tackle it I am more than happy to review it, My initial thought was maybe a node option that uses assert by default and if disabled we can use checkQueue to make sure it exists before trying anything.
Hey @Joffcom, I just opened the #8430, including the option to disable the assertion on exchanges too! Let me know what you think :)
Nice work 👍🏻
Fix got released with [email protected]
@ascariandrea your PR has been merged and release, I think we can mark this as closed. Thanks again for your work on that.