RabbitMQ & Docker: Failed to create thread: Operation not permitted (1)
Asked Answered
P

4

7

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

Paramedical answered 17/7, 2023 at 11:26 Comment(1)
If that's a copy & paste of the environment you passed, you've spelled it enviroment, so it will have been ignoredUnanimity
P
4

What version of Docker are you using? I had the same issue using Docker v19.03, but updating to Docker v24.0.5 resolved the problem for me.

Playoff answered 20/8, 2023 at 22:43 Comment(0)
L
2

adding root permissions to the container can solve it

privileged: true
Laboured answered 18/7, 2023 at 8:1 Comment(1)
yeah but what is the argument for doing so ? wouldn't that create a security issue ?Doublethink
I
1

I add the same issue with Docker 18.03 , solved with docker v20.10

Instructor answered 31/8, 2023 at 11:37 Comment(0)
U
0

I had the same issue with the offical RabbitMQ docker image running on Azure Pipelines:

Failed to create thread: Operation not permitted (1)
Aborted (core dumped)

With the following docker-compose file:

  rabbit:
    image: rabbitmq:3.10
    container_name: "rabbit_run_${IMAGE_TAG}"

    volumes:
      - ./config/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf

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:

  rabbit:
    image: bitnami/rabbitmq:3.11
    container_name: "rabbit_run_${IMAGE_TAG}"
    volumes:
      - ./config/rabbitmq.conf:/bitnami/rabbitmq/conf/custom.conf:ro
Ursulina answered 18/7, 2023 at 12:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.