I have a node.js application I have deployed on fly.io that I am trying to connect to another deployed docker instance of rabbit MQ. However, I am having trouble connecting to the rabbit MQ app to the platform due to this error that pops up on my node.js application:
{
errno: -4077,
code: 'ECONNRESET',
syscall: 'read'
}
I kind of have an idea of what this could be, but I’m not sure to be honest. Here is the docker file that I am trying to deploy:
FROM rabbitmq:3-management-alpine
COPY ./prod.conf /etc/rabbitmq/rabbitmq.conf
RUN rabbitmq-plugins enable rabbitmq_management
here is the fly TOML file:
# fly.toml app configuration file generated for rabbit-mq-fly-dep on 2024-09-25T14:16:38-04:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = 'rabbit-mq-fly-dep'
primary_region = 'atl'
[build]
[[services]]
protocol = "tcp"
internal_port = 5672
[[services.tcp_checks]]
interval = "15s"
timeout = "1m0s"
grace_period = "1s"
[[services]]
protocol = "tcp"
internal_port = 15672
[[services.ports]]
port = 15672
handlers = ["tls", "http"]
[[services.tcp_checks]]
interval = "15s"
timeout = "1m0s"
grace_period = "1s"
here is the .cofig file for the rabbit mq deployment
listeners.tcp.default = 5672
default_user = [my_rabbit_mq_password]
default_pass = [may_rabbit_mq_password]
management.tcp.ip = ::
I should also say that I did use the correct format for the amqp URL to connect via tcp and tls to the deployed rabbit mq instance:
RABIT_MQ_URL=amqp://username:password@rabbit-mq-fly-dep.fly.dev:portnumber/vhost
(NOTE:I should also say that I tried amqps, but no dice, unfortunately.)
I tried executing the code again and monitor the fly logs, but they didn’t update. I don’t understand this, because it says that the application started listening on the expected port (5672) as you can see within the respective line in the logs I have here:
2024-10-01T16:59:09Z app[d8dd761ce00038] atl [info]2024-10-01 16:59:09.111223+00:00 [info] <0.674.0> Ready to start client connection listeners
2024-10-01T16:59:09Z app[d8dd761ce00038] atl [info]2024-10-01 16:59:09.112324+00:00 [info] <0.832.0> started TCP listener on [::]:5672
2024-10-01T16:59:09Z app[d8dd761ce00038] atl [info] completed with 5 plugins.
2024-10-01T16:59:09Z app[d8dd761ce00038] atl [info]2024-10-01 16:59:09.173596+00:00 [info] <0.674.0> Server startup complete; 5 plugins started.
2024-10-01T16:59:09Z app[d8dd761ce00038] atl [info]2024-10-01 16:59:09.173596+00:00 [info] <0.674.0> * rabbitmq_prometheus
2024-10-01T16:59:09Z app[d8dd761ce00038] atl [info]2024-10-01 16:59:09.173596+00:00 [info] <0.674.0> * rabbitmq_federation
2024-10-01T16:59:09Z app[d8dd761ce00038] atl [info]2024-10-01 16:59:09.173596+00:00 [info] <0.674.0> * rabbitmq_management
2024-10-01T16:59:09Z app[d8dd761ce00038] atl [info]2024-10-01 16:59:09.173596+00:00 [info] <0.674.0> * rabbitmq_management_agent
2024-10-01T16:59:09Z app[d8dd761ce00038] atl [info]2024-10-01 16:59:09.173596+00:00 [info] <0.674.0> * rabbitmq_web_dispatch
2024-10-01T16:59:09Z app[d8dd761ce00038] atl [info]2024-10-01 16:59:09.306912+00:00 [info] <0.9.0> Time to start RabbitMQ: 6214 ms
2024-10-01T16:59:18Z health[d8dd761ce00038] atl [info]Health check on port 5672 is now passing.
2024-10-01T16:59:19Z health[d8dd761ce00038] atl [info]Health check on port 15672 is now passing.
2024-10-01T17:00:03Z app[d8dd761ce00038] atl [info]2024-10-01 17:00:03.182211+00:00 [notice] <0.86.0> alarm_handler: {set,{system_memory_high_watermark,[]}}
however, this resulted in the same error as above. I have been up and down the internet trying to solve this, but no luck. I would appreciate it if someone could give me a hand in this. LOL. Thanks!