definitions.json is breaking default_user

429 views
Skip to first unread message

Ewemek

unread,
Jan 31, 2023, 6:41:04 AM1/31/23
to rabbitmq-users
Hello, I'm trying to setup a simple server configuration at startup.
The rabbitmq.conf is fine until you need to create a default-ish queue.
I don't want to do any init step using the CLI nor the management API, so I tried to init the queue using the definitions.json file.

Even when I don't pass any users config in definitions.json, the default user is broken, and using rabbitmqctl, I'm able to see that no user has been crated. It's the same if I specify a user in the definitions.json. No error at startup about the file, I do see the log telling me definitions.json has been imported.

It seems to me that this is not an expected behaviour.

I'm using the docker image, version 3.11, I also tried with 3.9 and 3.10 just in case but I was getting the same result.

Michal Kuratczyk

unread,
Jan 31, 2023, 7:32:14 AM1/31/23
to rabbitm...@googlegroups.com
It is expected and documented behaviour:
"if a blank (uninitialised) node imports a definition file, it will not create the default virtual host and user."

Default definitions, including the default user, are just that - the default. Since you import your own definitions, those default do not apply.

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/ed4be966-7527-45ed-b3a1-720e949bcc27n%40googlegroups.com.


--
Michał
RabbitMQ team

Ewemek

unread,
Jan 31, 2023, 8:30:24 AM1/31/23
to rabbitmq-users
Okay, so that explains why the default user is not used, but when I specify a user in the "users" part of the definitions.json, it is not created either. Am I doing something wrong ?
After booting, I can confirm there is no user because `rabbitmqctl list_users` returns an empty list.
Here is my latest definitions.json (loaded with management.load_definitions config):
{
    "users": [
        {
            "name": "my_user",
            "password": "some_password",
            "tags": "administrator"
        }
    ],
    "vhosts": [
        {
            "name": "some_vhost"
        }
    ],
    "queues": [
        {
            "name": "queue1",
            "vhost": "some_vhost",
            "durable": true,
            "auto_delete": false,
            "arguments": {}
        }
    ]
}

Ewemek

unread,
Jan 31, 2023, 8:36:15 AM1/31/23
to rabbitmq-users
Well, I found my issue, it was just a typo and I was not using the file I gave.
My bad ! The user gets created as expected with this file.

Thanks for the insights though, Michal.

Best regards, and again, sorry :/.
Reply all
Reply to author
Forward
0 new messages