Replies: 11 comments 13 replies
-
What version of RabbitMQ and Erlang are you using? |
Beta Was this translation helpful? Give feedback.
-
What configuration can we use to reproduce? |
Beta Was this translation helpful? Give feedback.
-
CLI tools health check is not aware of the interface configuration. It does what most clients would do: connect using a hostname and a port. What specific interface should be used to connect is out of scope for most clients and this health check. To analyze the rest of the code flow we need to know what configuration you've used and what your expectations are. |
Beta Was this translation helpful? Give feedback.
-
On my production system: $ rabbitmqctl --version
3.11.6
$ aptitude versions erlang | grep i
i 1:25.2-1 bullseye 1000 Minimum configuration file to reproduce:
This is really easy to check. Just use the latest official docker image and you can reproduce this. On my production setup I am using the official debian package. $ docker run -it --rm --name rabbitmq_test \
-v $(pwd)/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro \
rabbitmq:3-management And then run: $ docker exec -it rabbitmq_test /bin/bash
# rabbitmqctl eval 'lists:nth(1, ets:tab2list(rabbit_listener_ets)).'
{listener,rabbit@afb753a5dbc5,http,"afb753a5dbc5",
{0,0,0,0,0,0,0,0},
15672,
[{cowboy_opts,[{sendfile,false}]},{ip,"127.0.0.1"},{port,15672}]}
# rabbitmq-diagnostics listeners
Asking node rabbit@afb753a5dbc5 to report its protocol listeners ...
Interface: [::], port: 15672, protocol: http, purpose: HTTP API
Interface: [::], port: 15692, protocol: http/prometheus, purpose: Prometheus exporter API over HTTP
Interface: [::], port: 25672, protocol: clustering, purpose: inter-node and CLI tool communication
Interface: [::], port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0 Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
IMHO this must be documented. Additionally, giving the interface in the console output is misleading as it suggests that the interface address is used to connect to the service. However, the value here will be whatever the hostname resolves to. Additionally, I think this is not what most people do. I think, most people have HTTP APIs behind a reverse proxy. The URL and domain of the reverse proxy are completely unknown to rabbitmq. Using the hostname for connections is IMHO a wild guess. I would expect rabbitmq to just use the IP address that is configured in the configuration file. Any other connectivity checks are out of scope for rabbitmq. |
Beta Was this translation helpful? Give feedback.
-
In what console output? It's one thing if it's listed in listener information and another in the check itself. @fin-ger you are making wild claims about what most people do or do not do. I will make one, too: you are the first person to complain about this check in a couple of years of its existence. Most people do not override listeners, and listeners can be configured to use I'll how realistic it might be to use a specific IP address if it's available but to me |
Beta Was this translation helpful? Give feedback.
-
rabbitmq/rabbitmq-website@99e3019 adds a note to the Monitoring guide that explains how the health check decides where to connect. #6852 and #6853 are the only ideas I have since CLI tools cannot know what IP address to use to connect to listeners bound to |
Beta Was this translation helpful? Give feedback.
-
@fin-ger @michaelklishin I created a repository to reproduce this issue: https://github.com/lukebakken/rabbitmq-server-6851 Clone it and run
So this appears to be an issue with the management plugin. My guess is that other plugins that start listeners may be affected as well.
Listening ports within the container:
|
Beta Was this translation helpful? Give feedback.
-
I think it related to dns.
First case explains why we see this problem more often in docker, the networking setup is more complex. Thought I can repeat it on my machine too, not docker. This prompts me to wonder when exactly we want to resolve hostnames. Wouldn't it make more sense to not check by hostname at all and always use stored listener ip address if not overriden. |
Beta Was this translation helpful? Give feedback.
-
When a listener is bound to a specific address, ideally CLI tools should discover that and use it. When it is bound to
Ironically, in order to get that specific IP address configured, we must guess how to contact the node. At the very least we can make sure that the correct values are stored in the tables, By the way, I regret adding the |
Beta Was this translation helpful? Give feedback.
-
FTR, while this is not really a part of this discussion, I have updated https://rabbitmq.com/monitoring.html#health-checks to mention that |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am currently investigating on an issue regarding the
rabbitmq-diagnostics listeners
andcheck_port_connectivity
commands. Both commands always report the binding interface for all ports to be[::]
regardless of the configuration. On my setup this leads to failed connectivity checks although the ports are open and running.I investigated the code and first found that the
check_port_connectivity
is not using the configured binding interface but instead is resolving the hostname to connect to a service port.However, this logic is not used to create the console output of
listeners
which explicitly states that all services are running behind[::]
. I investigated where this output is produced and found out that the code reads the interface (or ip-address) from alistener
record.I figured out that this
listener
record is fetched from theETS_TABLE
.I checked the contents of the
ETS_TABLE
withI found the definition for the
listener
type in theETS_TABLE
which references thelistener
record. This shows that the IP address is the fourth element in the record, so it should be{0,0,0,0,0,0,0,0}
as derived from the output. However, this is wrong. I explicitly set this to127.0.0.1
(e.g. viaprometheus.tcp.ip = 127.0.0.1
andmanagement.tcp.ip = 127.0.0.1
). In fact, the value is always{0,0,0,0,0,0,0,0}
regardless of configuration.I searched further and first found that the IP address is missing from the type definition. Second, the
listener
instance used to create and start atcp_listener
is altered in a couple of functions before being inserted into theETC_TABLE
. After a listener has been successfully started alistener_info
is created which somehow fetches theIPAddress
from thePort
. I did not fully understand this code and don't know whether a fault occurs here. After that, the new listener is being registered in theETS_TABLE
. The data stored after this point seems to be faulty as the data read from theETS_TABLE
does not include the correct binding interface. It has to be noted that all services are running on the correct ports and interfaces (checked withnetstat
). Only the data in theETS_TABLE
is wrong.As I do not know Erlang nor Elixir, I am not sure whether my analysis is correct, however I think that the handling of the
ip_address
field in thelistener
record is wrong. First during registration of the listener in theETS_TABLE
and later when using thelistener
record in the diagnostics tools.Beta Was this translation helpful? Give feedback.
All reactions