Skip to content

Conversation

@lukebakken
Copy link
Collaborator

@lukebakken lukebakken commented Sep 5, 2025

Fixes #14509

A list of binaries was incorrectly converted by unicode:characters_to_binary into one big binary. Add a function head to match this case.

Also, add tests for the values that were not correctly formatted prior to #14101 and #14381

A list of binaries was incorrectly converted by
`unicode:characters_to_binary` into one big binary. Add a function head
to match this case.

Also, add tests for the values that were not correctly formatted prior
to rabbitmq#14101 and rabbitmq#14381
Copy link
Collaborator

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave this a try locally and status looks good to me now

main:

{
  // ...
  "enabled_plugin_file": "/tmp/rabbitmq-test-instances/rabbit-1@mango2/enabled_plugins",
  "active_plugins": "rabbitmq_auth_backend_httprabbitmq_shovel_managementrabbitmq_recent_history_exchangerabbitmq_peer_discovery_k8srabbitmq_event_exchangerabbitmq_shardingrabbitmq_auth_mechanism_sslrabbitmq_peer_discovery_awsrabbitmq_awsrabbitmq_toprabbitmq_stream_managementrabbitmq_streamrabbitmq_stream_commonrabbitmq_peer_discovery_consulrabbitmq_random_exchangerabbitmq_tracingrabbitmq_federation_prometheusrabbitmq_trust_storerabbitmq_peer_discovery_etcdrabbitmq_peer_discovery_commoneetcdrabbitmq_auth_backend_ldaprabbitmq_federation_managementrabbitmq_managementrabbitmq_federationrabbitmq_queue_federationrabbitmq_exchange_federationrabbitmq_federation_commonrabbitmq_auth_backend_oauth2base64urloauth2_clientjoserabbitmq_consistent_hash_exchangerabbitmq_auth_backend_internal_loopbackrabbitmq_web_stomp_examplesrabbitmq_web_stomprabbitmq_stomprabbitmq_jms_topic_exchangerabbitmq_web_mqtt_examplesrabbitmq_web_mqttrabbitmq_mqttrabbitmq_shovel_prometheusrabbitmq_shovelamqp10_clientgunrabbitmq_prometheusacceptrabbitmq_management_agentprometheusrabbitmq_web_dispatchamqp_clientcowboyrabbitmq_auth_backend_cacherabbitmq_amqp1_0",
  "data_directory": "/tmp/rabbitmq-test-instances/rabbit-1@mango2/mnesia/rabbit-1@mango2",
  "raft_data_directory": "/tmp/rabbitmq-test-instances/rabbit-1@mango2/mnesia/rabbit-1@mango2/quorum/rabbit-1@mango2",
  "log_files": "/tmp/rabbitmq-test-instances/rabbit-1@mango2/log/[email protected]<stdout>",
  // ...
}

This branch:

{
  // ...
  "enabled_plugin_file": "/tmp/rabbitmq-test-instances/rabbit-1@mango2/enabled_plugins",
  "active_plugins": [
    "rabbitmq_auth_backend_http",
    // ...
    "rabbitmq_amqp1_0"
  ],
  "data_directory": "/tmp/rabbitmq-test-instances/rabbit-1@mango2/mnesia/rabbit-1@mango2",
  "raft_data_directory": "/tmp/rabbitmq-test-instances/rabbit-1@mango2/mnesia/rabbit-1@mango2/quorum/rabbit-1@mango2",
  "log_files": [
    "/tmp/rabbitmq-test-instances/rabbit-1@mango2/log/[email protected]",
    "<stdout>"
  ],
  // ...
}

@michaelklishin
Copy link
Collaborator

@lukebakken @the-mikedavis thank you for the quick turnaround!

@lukebakken lukebakken merged commit 3280bed into rabbitmq:main Sep 5, 2025
557 of 559 checks passed
@lukebakken lukebakken deleted the lukebakken/rabbitmq-server-14509 branch September 5, 2025 19:29
mergify bot pushed a commit that referenced this pull request Sep 5, 2025
A list of binaries was incorrectly converted by
`unicode:characters_to_binary` into one big binary. Add a function head
to match this case.

Also, add tests for the values that were not correctly formatted prior
to #14101 and #14381

(cherry picked from commit 3280bed)
michaelklishin added a commit that referenced this pull request Sep 5, 2025
Additional JSON CLI formatter fix (backport #14511)
mergify bot pushed a commit that referenced this pull request Sep 5, 2025
A list of binaries was incorrectly converted by
`unicode:characters_to_binary` into one big binary. Add a function head
to match this case.

Also, add tests for the values that were not correctly formatted prior
to #14101 and #14381

(cherry picked from commit 3280bed)
(cherry picked from commit fe0697d)
michaelklishin added a commit that referenced this pull request Sep 5, 2025
Additional JSON CLI formatter fix (backport #14511) (backport #14512)
lukebakken added a commit to lukebakken/rmq-rabbitmq-server that referenced this pull request Oct 21, 2025
The bug addressed by this PR was found while running the following
command:

```
rabbitmqctl environment --formatter=json
```

...after configuring the `rabbit` application to use `cacerts` with a
list of binaries as the value, rather than `cacertfile`.

This PR also fixes the formatting of the `tcp_listeners` and
`ssl_listeners` output, because `[5672]` is a valid list of unicode
codepoints that `unicode:characters_to_binary` will happily convert it,
resulting in `"tcp_listeners": "ᘨ"` in the output.

I also ensured that the fixes in rabbitmq#14511 and rabbitmq#14398 still work as
intended.
lukebakken added a commit to lukebakken/rmq-rabbitmq-server that referenced this pull request Oct 22, 2025
The bug addressed by this PR was found while running the following
command:

```
rabbitmqctl environment --formatter=json
```

...after configuring the `rabbit` application to use `cacerts` with a
list of binaries as the value, rather than `cacertfile`.

This PR also fixes the formatting of the `tcp_listeners` and
`ssl_listeners` output, because `[5672]` is a valid list of unicode
codepoints that `unicode:characters_to_binary` will happily convert it,
resulting in `"tcp_listeners": "ᘨ"` in the output.

I also ensured that the fixes in rabbitmq#14511 and rabbitmq#14398 still work as
intended.
mergify bot pushed a commit that referenced this pull request Oct 22, 2025
The bug addressed by this PR was found while running the following
command:

```
rabbitmqctl environment --formatter=json
```

...after configuring the `rabbit` application to use `cacerts` with a
list of binaries as the value, rather than `cacertfile`.

This PR also fixes the formatting of the `tcp_listeners` and
`ssl_listeners` output, because `[5672]` is a valid list of unicode
codepoints that `unicode:characters_to_binary` will happily convert it,
resulting in `"tcp_listeners": "ᘨ"` in the output.

I also ensured that the fixes in #14511 and #14398 still work as
intended.

(cherry picked from commit 4072326)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4.1.4: 'rabbitmq-diagnostics status --formatter json' incorrectly formats a few collection keys (again)

3 participants