Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Deprecate RABBITMQ_ERLANG_COOKIE env variable support #445

Merged
merged 2 commits into from
Jul 3, 2020

Conversation

michaelklishin
Copy link
Member

It's not worth the confusion it causes in practice since the server does not support it.

To test:

RABBITMQ_ERLANG_COOKIE=$(cat $HOME/.erlang.cookie) ERL_LIBS=../rabbit/plugins ./escript/rabbitmqctl status

RABBITMQ_ERLANG_COOKIE="mismatching-value" ERL_LIBS=../rabbit/plugins ./escript/rabbitmqctl status

ERL_LIBS=../rabbit/plugins ./escript/rabbitmqctl status --erlang-cookie $(cat $HOME/.erlang.cookie)

ERL_LIBS=../rabbit/plugins ./escript/rabbitmqctl status --erlang-cookie mismatching-value

Per discussion with @gerhard @dumbbell.

Closes #443.

It's not worth the confusion it causes in practice since
the server does not support it.

Per discussion with @gerhard @dumbbell.

Closes #443.
@michaelklishin michaelklishin requested a review from gerhard July 2, 2020 05:28
@gerhard
Copy link
Contributor

gerhard commented Jul 2, 2020

This looks good!

$ RABBITMQ_ERLANG_COOKIE=foo sbin/rabbitmqctl status
RABBITMQ_ERLANG_COOKIE env variable support is deprecated and will be REMOVED in a future version. Use the $HOME/.erlang.cookie file or the --erlang-cookie switch instead.
Error: unable to perform an operation on node 'rabbit@focker'. Please see diagnostics information and suggestions below.
...

Could we make it stand out more? I'm thinking bold and red, something like this:

$ RABBITMQ_ERLANG_COOKIE=foo sbin/rabbitmqctl status

- RABBITMQ_ERLANG_COOKIE env variable support is deprecated and will be REMOVED in a future version.
- Use the $HOME/.erlang.cookie file or the --erlang-cookie switch instead.

Error: unable to perform an operation on node 'rabbit@focker'. Please see diagnostics information and suggestions below.
...

I was also thinking that maybe we should print a warning if the value of the RABBITMQ_ERLANG_COOKIE env var differs from the erlang cookie file value. It's OK if you think that it's out of scope, but I can see how it would be helpful.

@michaelklishin
Copy link
Member Author

michaelklishin commented Jul 3, 2020

I am reluctant to make CLI tools [explicitly] read the cookie file.

@michaelklishin
Copy link
Member Author

michaelklishin commented Jul 3, 2020

I've made the message print

RABBITMQ_ERLANG_COOKIE env variable support is deprecated and will be REMOVED in a future version.

bold and in red, and

Use the $HOME/.erlang.cookie file or the --erlang-cookie switch instead.

in yellow to stand out more.

@michaelklishin michaelklishin merged commit 3a83697 into master Jul 3, 2020
michaelklishin added a commit that referenced this pull request Jul 3, 2020
Deprecate RABBITMQ_ERLANG_COOKIE env variable support

(cherry picked from commit 3a83697)
@michaelklishin michaelklishin deleted the rabbitmq-cli-443 branch July 3, 2020 02:09
@michaelklishin
Copy link
Member Author

Backported to v3.8.x.

@gerhard
Copy link
Contributor

gerhard commented Jul 3, 2020

It stands out now on both dark & light backgrounds 👍🏻

Dark

image

Light

image

@michaelklishin
Copy link
Member Author

A little hard to read the part in yellow with a white background but I guess most color choices would not be equally legible.

@gerhard
Copy link
Contributor

gerhard commented Jul 3, 2020

Maybe bold instead of yellow?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RABBITMQ_ERLANG_COOKIE environment variable takes precedence over .erlang.cookie file
2 participants