Unable to connect to RabbitMQ via localhost or 127.0.0.1 #646
-
Describe the bugI am encountering an issue when trying to connect to RabbitMQ using localhost or 127.0.0.1. I am running it within a Docker container that is on the same network as RabbitMQ server. However, I can only connect using the container Docker's IP address. I have checked the output of the "rabbitmq-diagnostics listeners" command and noticed that RabbitMQ is configured to listen on all IPv6 interfaces. However, it seems that it is not configured to listen on IPv4 interfaces such as localhost or 127.0.0.1.
I have tried modifying the RabbitMQ configuration to include localhost and 127.0.0.1 as listening interfaces in the configuration file, but without success. I used the following configurations:
or
Describe the bugI am encountering an issue when trying to connect to RabbitMQ using localhost or 127.0.0.1. I am running it within a Docker container that is on the same network as RabbitMQ server. However, I can only connect using the container Docker's IP address. I have checked the output of the "rabbitmq-diagnostics listeners" command and noticed that RabbitMQ is configured to listen on all IPv6 interfaces. However, it seems that it is not configured to listen on IPv4 interfaces such as localhost or 127.0.0.1.
I have tried modifying the RabbitMQ configuration to include localhost and 127.0.0.1 as listening interfaces in the configuration file, but without success. I used the following configurations:
or
/code # python rabbitmqadmin -H 127.0.0.1 -u guest -p guest list vhosts
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
the problem occurred while using this library revsys/django-health-check#369 (comment) |
Beta Was this translation helpful? Give feedback.
-
Hello, thanks for using RabbitMQ. Please provide a docker compose project that starts containers in exactly the same way you do, using the same configuration. Right now you're asking us to guess at how to reproduce this problem, which takes time away from actually diagnosing it, and also usually leads to errors on our part. I should be able to clone a git repository and run If you are unfamiliar with docker compose, then provide a means for us to start these containers the same way you are. A script is ideal. |
Beta Was this translation helpful? Give feedback.
-
the first 2 test commands with rabbitmqadmin work, the last 2 don't |
Beta Was this translation helpful? Give feedback.
Thanks for those details. Why do you expect these two commands to work?
They are attempting to connect to port
15672
of the container runningpython3 rabbitmqadmin
. RabbitMQ is running in an entirely different container.