Skip to content

function_clause when loading a virtual host-specific definitions file at boot time #10068

@lukebakken

Description

@lukebakken

Describe the bug

RabbitMQ version - 3.12.10
Originally reported here - https://groups.google.com/g/rabbitmq-users/c/oLnrjOJAxM0

Loading a provided definitions.json file results in the following crash at boot:

RabbitMQ Boot Output
2023-12-07 12:57:12.714000-08:00 [info] <0.526.0> Applying definitions from regular file at C:/Users/lbakken/development/lukebakken/rabbitmq-users-oLnrjOJAxM0/definitions.json
2023-12-07 12:57:12.715000-08:00 [info] <0.526.0> Applying definitions from file at 'C:/Users/lbakken/development/lukebakken/rabbitmq-users-oLnrjOJAxM0/definitions.json'
2023-12-07 12:57:12.715000-08:00 [info] <0.526.0> Asked to import definitions. Acting user: rmq-internal
1>
BOOT FAILED
===========
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0>
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0> BOOT FAILED
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0> ===========
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0> Exception during startup:
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0>
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0> error:function_clause
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0>
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0>     rabbit_db_rtparams:get_all/2, line 178
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0>         args: [undefined,<<"vhost-limits">>]
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0>     rabbit_runtime_parameters:list/2, line 261
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0>     rabbit_vhost_limit:get_limit/2, line 192
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0>     rabbit_vhost_limit:would_exceed_queue_limit/2, line 111
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0>     rabbit_definitions:validate_vhost_limit/3, line 867
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0>     maps:fold_1/4, line 416
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0>     rabbit_definitions:apply_defs/3, line 433
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0>     rabbit_definitions:maybe_load_definitions/0, line 100
2023-12-07 12:57:12.724000-08:00 [error] <0.526.0>
1> Exception during startup:

error:function_clause

    rabbit_db_rtparams:get_all/2, line 178
        args: [undefined,<<"vhost-limits">>]
    rabbit_runtime_parameters:list/2, line 261
    rabbit_vhost_limit:get_limit/2, line 192
    rabbit_vhost_limit:would_exceed_queue_limit/2, line 111
    rabbit_definitions:validate_vhost_limit/3, line 867
    maps:fold_1/4, line 416
    rabbit_definitions:apply_defs/3, line 433
    rabbit_definitions:maybe_load_definitions/0, line 100

Reproduction steps

Configure RabbitMQ to load the defititions.json file from here:

https://github.com/lukebakken/rabbitmq-users-oLnrjOJAxM0

Note that the path in rabbitmq.conf will have to be adjusted.

Expected behavior

No crash.

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions