Skip to content

rabbitmqctl environment JSON output prints all string()s as-is #14101

@the-mikedavis

Description

@the-mikedavis

Describe the bug

Erlang string()s in application env are printed by rabbitmqctl environment --formatter=json as lists of bytes rather than as JSON strings.

Reproduction steps

  1. make run-broker
  2. rabbitmqctl environment --formatter=json

Expected behavior

Values like application:get_env(rabbit, cluster_name) should be printed as JSON strings like "cluster_name":"localhost". Currently they are printed as lists of bytes: "cluster_name":[108,111,99,97,108,104,111,115,116]

Additional context

Any binary()s and atom()s are printed as expected, like "anonymous_login_user":"guest".

I'm not sure this can be solved without false-positives but we can try to do as well as EShell and convert lists of UTF-8-looking bytes to binaries.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions