I’m using RabbitMQ in a docker swarm which has multiple services, all the other services are starting up fine, but the RabbitMQ container doesn’t, and the logs show the following error:
Failed to create thread: Operation not permitted (1)
Aborted (core dumped)
My docker-compose.yml file looks like this:
version: "3.6"
networks:
rabbitmq:
driver: overlay
attachable: true
x-logging: &default-logging
driver: json-file
options:
max-size: "10m"
max-file: "5"
services:
rabbitmq:
image: rabbitmq:3
hostname: rabbitmq
logging: *default-logging
deploy:
mode: replicated
replicas: 1
labels:
- "traefik.enable=false"
networks:
- rabbitmq
I tried passing this environment variable:
enviroment:
- RABBITMQ_IO_THREAD_POOL_SIZE=10 # Decreasing the number of threads
This was meant to decrease the number of threads in case that was the issue, but there was no difference.
What could be causing this error, and how could I go about fixing it?
Thanks in advance
2
Answers
adding root permissions to the container can solve it
I had the same issue with the offical RabbitMQ docker image running on Azure Pipelines:
With the following docker-compose file:
I tried switching to bitnami/rabbitmq:3.11 in the same environment and this worked for me. This is however a workaround, and NOT a solution to fixing your problem with the official image: