Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Definitions import of bad json goes unnoticed #2610

Closed
lukebakken opened this issue Feb 24, 2020 · 2 comments · Fixed by #6418
Closed

Definitions import of bad json goes unnoticed #2610

lukebakken opened this issue Feb 24, 2020 · 2 comments · Fixed by #6418

Comments

@lukebakken
Copy link
Collaborator

To reproduce:

  • Save this file as definitions-bad.json: definitions-bad.json.txt
  • Enable the management plugin
  • Use the following configuration line in rabbitmq.conf:
    management.load_definitions = /path/to/definitions-bad.json
    
  • Start RabbitMQ

Observed: RabbitMQ starts fine, nothing is logged to indicate the invalid JSON in that file.

Expected: log message(s) indicating bad JSON

Loading invalid definitions without using rabbitmq_management in master prevents RabbitMQ from starting.

@jms1voalte
Copy link

To clarify, this happened using the 3.8.2-1.el7 RPM on CentOS 7.

Also I noticed that normally there's a specific sequence of log messages produced during the import:

2020-02-18 18:05:22.532 [info] <0.339.0> Asked to import definitions. Acting user: rmq-internal
2020-02-18 18:05:22.533 [info] <0.339.0> Importing users...
2020-02-18 18:05:22.533 [info] <0.339.0> Importing vhosts...
2020-02-18 18:05:22.533 [info] <0.339.0> Importing user permissions...
2020-02-18 18:05:22.533 [info] <0.339.0> Importing topic permissions...
2020-02-18 18:05:22.533 [info] <0.339.0> Importing parameters...
2020-02-18 18:05:22.586 [info] <0.339.0> Importing global parameters...
2020-02-18 18:05:22.586 [info] <0.339.0> Importing policies...
2020-02-18 18:05:22.626 [info] <0.339.0> Importing queues...
2020-02-18 18:05:22.652 [info] <0.339.0> Importing exchanges...
2020-02-18 18:05:22.653 [info] <0.339.0> Importing bindings...
2020-02-18 18:05:22.676 [info] <0.339.0> Running boot step empty_db_check defined by app rabbit

When the file is bad, this list of log messages stops but the node keeps starting up:

2020-02-21 17:41:28.630 [info] <0.26638.7> Asked to import definitions. Acting user: rmq-internal
2020-02-21 17:41:28.630 [info] <0.26638.7> Importing users...
2020-02-21 17:41:28.630 [info] <0.26638.7> Importing vhosts...
2020-02-21 17:41:28.631 [info] <0.26638.7> Running boot step empty_db_check defined by app rabbit

@dcorbacho dcorbacho transferred this issue from rabbitmq/rabbitmq-management Nov 17, 2020
@mjattie
Copy link

mjattie commented Nov 11, 2022

encountered this today as well, had json that worked fine in the 3.10 release, but because the json serializer changed in 3.11, the import failed suddenly. There was a comma at the end of a value that shouldn't be there... Would be nice to have a log message!

@michaelklishin michaelklishin added this to the 3.11.4 milestone Nov 16, 2022
michaelklishin added a commit that referenced this issue May 28, 2023
and `definitions.skip_if_unchanged` is set to `true`.

References #2610, #6418.
Closes #8372.
mergify bot pushed a commit that referenced this issue May 28, 2023
and `definitions.skip_if_unchanged` is set to `true`.

References #2610, #6418.
Closes #8372.

(cherry picked from commit 0c6f8aa)
mergify bot pushed a commit that referenced this issue May 28, 2023
and `definitions.skip_if_unchanged` is set to `true`.

References #2610, #6418.
Closes #8372.

(cherry picked from commit 0c6f8aa)
(cherry picked from commit 7e7431a)

# Conflicts:
#	deps/rabbit/src/rabbit_definitions.erl
#	deps/rabbit/test/definition_import_SUITE.erl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants