Worker Service doesn't connect to RabbitMQ container and always exits with 139 code #4840
Replies: 5 comments 6 replies
-
Can you share the compose file? |
Beta Was this translation helpful? Give feedback.
-
If it fails only from a Docker container, is it possible that you can't access the RabbitMQ service at all because the container is not configured to allow outbound connections to its port? Have you already verified the RabbitMQ port can be accessed from the docker container? |
Beta Was this translation helpful? Give feedback.
-
@richlander it is here version: '3.4'
services:
rabbitmq:
container_name: rabbitmq
image: rabbitmq:3-management-alpine
restart: always
ports:
- 5672:5672
- 15672:15672
volumes:
- ~/.docker-conf/rabbitmq/data/:/var/lib/rabbitmq/
- ~/.docker-conf/rabbitmq/log/:/var/log/rabbitmq
networks:
- default
microraptor:
container_name: microraptor
image: ${DOCKER_REGISTRY-}microraptor
build:
context: .
dockerfile: MicroRaptor/Dockerfile
ports:
- "5003:80"
restart: always
depends_on:
- mongodb
networks:
- default
taurusworker:
container_name: taurusworker
image: ${DOCKER_REGISTRY-}taurusworker
build:
context: .
dockerfile: Services/TaurusWorker/Dockerfile
networks:
- default
networks:
default:
driver: bridge
volumes:
mongo-data:
elasticsearch-data:
|
Beta Was this translation helpful? Give feedback.
-
Hi guys, I have this problem in my .net core 8.0 project. Has anyone had any answers on how to solve it? I also have a worker service project that reads messages from a queue in rabbit mq and receives the same error message. |
Beta Was this translation helpful? Give feedback.
-
@elyosemite @PDaguis What's your rabbitmq configuration in taurus worker? Since all your services are in the same network, you should be able to access it via service name you've defined in your compose file like this: _factory = new ConnectionFactory() { HostName = "rabbitmq", Port = 5672 }; PS: You should remove the version tag in your compose file. It's deprecated. |
Beta Was this translation helpful? Give feedback.
-
I have three services:
TaurusWorker
,MicroRaptor
and theRabbitMQ
service. TheTaurusWorker
's responsibility is to read from a queue and send it to a MicroRaptor endpoint REST. There are two execution scenarios here, running TaurusWorker from a Docker container or running locally via Visual Studio Community.When I run it using Visual Studio Community, the application runs perfectly, with no errors. However, when running using the Docker container, I get an error connecting to the RabbitMQ service. Because of this I thought it might be a Docker bug.
Describe the Bug
I get the following error message from inside the
TaurusWorker
container:When running
docker-compose up
, theTaurusWorker
container crashes with code139
. My oddity is that it works when running throughVisual Studio Community 2022 Version 17.6.5
Other Information
Image Docker that I'm using to
TaurusWorker
:Image Docker that I'm using to
MicroRaptor
:Output of
docker version
Output of
docker info
Thanks for helping me!
Beta Was this translation helpful? Give feedback.
All reactions