load_definitions is not respected

526 views
Skip to first unread message

Vangelis Katsikaros

unread,
Jan 26, 2023, 3:22:41 AM1/26/23
to rabbitmq-users
Hi

I have a single node rabbitmq [1]. I noticed queue definition error for queue "foo", I tried to fix it and failed

I have this line in my /etc/rabbitmq/rabbitmq.conf

$ grep load /etc/rabbitmq/rabbitmq.conf
load_definitions = /etc/rabbitmq/load_definitions.json

I had a queue configured as
$ jq .queues[1] /etc/rabbitmq/load_definitions.json
{
"arguments": {
"x-queue-type": "classic"
},
"auto_delete": false,
"durable": true,
"name": "foo",
"type": "classic",
"vhost": "/"
}
and `rabbitmqctl report` showed that "durable" was "true" [2]. So far everything is consistent.

I saw this error in the logs
2023-01-26 08:08:55.977 [error] <0.10315.16> Channel error on connection <0.10304.16> (10.40.11.59:38790 -> 10.40.12.32:5672, vhost: '/', user: 'userfoo'), channel 1:
operation queue.declare caused a channel exception precondition_failed: inequivalent arg 'durable' for queue 'fluent' in vhost '/': received 'false' but current is 'true'

so I changed "durable" from "true" to "false" in the load definitions file
$ jq .queues[1] /etc/rabbitmq/load_definitions.json
{
"arguments": {
"x-queue-type": "classic"
},
"auto_delete": false,
"durable": false,
"name": "foo",
"type": "classic",
"vhost": "/"
}

and then restarted (also tried to stop and then start) the service with `systemctl restart rabbitmq-server.service`
I saw in the logs that the load definitions file was read and imported [3]

However, I still
a) get the same error in the logs
b) and `rabbitmqctl report` still shows that "durable" is "true"

I'd like to ask what is going on and how can I fix this issue?

Regards
Vangelis

[1]
on Ubuntu 22.04 `rabbitmqctl report` extract
...skip...
RabbitMQ version: 3.8.35
Erlang configuration: Erlang/OTP 24 [erts-12.2.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit]
Crypto library: OpenSSL 3.0.2 15 Mar 2022
...skip...
Cluster status of node rabbit@foobar ...
Basics
Cluster name: rab...@foobar.us-west-2.compute.internal

Disk Nodes
rabbit@foobar

Running Nodes
rabbit@foobar

Versions
rabbit@foobar: RabbitMQ 3.8.35 on Erlang 24.2.1
...skip...

[2]
Listing queues for vhost / ...
name durable auto_delete arguments policy pid owner_pid exclusive exclusive_consumer_pid exclusive_consumer_tag messages_ready messages_unacknowledged messages messages_ready_ram messages_unacknowledged_ram messages_ram messages_persistent message_bytes message_bytes_ready message_bytes_unacknowledged message_bytes_ram message_bytes_persistent head_message_timestamp disk_reads disk_writes consumers consumer_utilisation consumer_capacity memory slave_pids synchronised_slave_pids state type
foo true false [{"x-queue-type","classic"}] <rabbit@ip-10-40-12-32.1673865744.849.0> false 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 55440 running classic

[3]
2023-01-25 17:23:25.202 [info] <0.550.0> Applying definitions from file at '/etc/rabbitmq/load_definitions.json'
2023-01-25 17:23:25.202 [info] <0.550.0> Asked to import definitions. Acting user: rmq-internal
2023-01-25 17:23:25.203 [info] <0.550.0> Importing concurrently 3 users...
2023-01-25 17:23:25.208 [info] <0.550.0> Importing concurrently 1 vhosts...
2023-01-25 17:23:25.208 [info] <0.550.0> Importing concurrently 3 permissions...
2023-01-25 17:23:25.209 [debug] <0.547.0> Asked to set permissions for 'guest' in virtual host '/' to '.*', '.*', '.*'
2023-01-25 17:23:25.209 [debug] <0.548.0> Asked to set permissions for 'userfoo' in virtual host '/' to '.*', '.*', '.*'
2023-01-25 17:23:25.211 [info] <0.547.0> Successfully set permissions for 'guest' in virtual host '/' to '.*', '.*', '.*'
2023-01-25 17:23:25.211 [info] <0.548.0> Successfully set permissions for 'userfoo' in virtual host '/' to '.*', '.*', '.*'
2023-01-25 17:23:25.211 [debug] <0.547.0> Asked to set permissions for 'admin' in virtual host '/' to '.*', '.*', '.*'
2023-01-25 17:23:25.213 [info] <0.547.0> Successfully set permissions for 'admin' in virtual host '/' to '.*', '.*', '.*'
2023-01-25 17:23:25.214 [info] <0.550.0> Importing concurrently 4 queues...
2023-01-25 17:23:25.219 [info] <0.550.0> Importing sequentially 1 policies...
2023-01-25 17:23:25.219 [debug] <0.550.0> Asked to set or update runtime parameter 'events' in vhost '/' for component 'policy', value: [{<<"pattern">>,<<"^events*">>},{<<"definition">>,[{<<"ha-mode">>,<<"exactly">>},{<<"ha-params">>,3}]},{<<"priority">>,1},{<<"apply-to">>,<<"queues">>}]

Michal Kuratczyk

unread,
Jan 26, 2023, 3:31:48 AM1/26/23
to rabbitm...@googlegroups.com
Thanks for a very clear explanation of your issue. However, it seems that what your perceive as an issue is actually everything working as designed:

"The definitions in the file will not overwrite anything already in the broker."

Therefore, changing the definition of an existing queue is ignored since this queue already exists and RabbitMQ would have to delete it to import the new definition.
Such an implicit queue deletion could lead to unexpected data loss.

PS 3.8 is a very old version.

Best,

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/53334d3e-ba68-4a7d-8e23-b0d06a84e1d9n%40googlegroups.com.


--
Michał
RabbitMQ team

Vangelis Katsikaros

unread,
Jan 26, 2023, 3:41:48 AM1/26/23
to rabbitmq-users
Thanks for the quick reply Michał

Ignorance and wrong expectations from my end :) thanks for the explanation, seems I have to do further reading

Regards
Vangelis
Reply all
Reply to author
Forward
0 new messages