n8n icon indicating copy to clipboard operation
n8n copied to clipboard

Rabbit MQ QueueDeclare for user with no "queue.declare" permissions

Open ascariandrea opened this issue 1 year ago • 6 comments

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

ascariandrea avatar Jan 23 '24 12:01 ascariandrea

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?

Joffcom avatar Jan 23 '24 16:01 Joffcom

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 👍🏽

ascariandrea avatar Jan 23 '24 16:01 ascariandrea

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.

Joffcom avatar Jan 23 '24 16:01 Joffcom

Hey @Joffcom, I just opened the #8430, including the option to disable the assertion on exchanges too! Let me know what you think :)

ascariandrea avatar Jan 24 '24 14:01 ascariandrea

Nice work 👍🏻

Joffcom avatar Jan 24 '24 14:01 Joffcom

Fix got released with [email protected]

janober avatar Feb 07 '24 15:02 janober

@ascariandrea your PR has been merged and release, I think we can mark this as closed. Thanks again for your work on that.

Joffcom avatar Feb 08 '24 08:02 Joffcom