Skip to content

Fix CI failure: RabbitMQ 4.x incompatible with Celery's transient_nonexcl_queues #679

@CasperWA-ai-bot

Description

@CasperWA-ai-bot

Problem / Goal

The test_celery_remote test fails on all Linux CI runners because pytest-celery uses rabbitmq:latest as its default Docker image for the broker, and RabbitMQ 4.x has removed support for the transient_nonexcl_queues feature that Celery/kombu relies on.
This blocks every PR until the issue is resolved, including auto-update PRs such as #677.

Context

Reproduction

The failure occurs automatically on all Linux CI runs. The exact error from the Celery worker container is:

amqp.exceptions.InternalError: Queue.declare: (541) INTERNAL_ERROR -
Feature `transient_nonexcl_queues` is deprecated.
By default, this feature is not permitted anymore.

Celery's mingle boot-step calls Queue.declare on a transient, non-exclusive queue (the celery.pidbox broadcast mailbox) during worker startup.
RabbitMQ 4.x rejects this call with a hard 541 error, crashing the worker before it can become ready.
pytest-docker-tools then times out after 30 s waiting for the worker container, surfacing as ContainerNotReady.

Considerations

Three approaches were considered:

1. Pin the RabbitMQ Docker image to rabbitmq:3 (chosen)

Override the default_rabbitmq_broker_image pytest fixture in tests/strategies/transformation/conftest.py to return "rabbitmq:3" instead of "rabbitmq:latest".
This fixture is explicitly provided by pytest-celery as an override point.

  • Pro: Minimal, targeted change. No behaviour difference in the tests. Compatible with current Celery/kombu.
  • Con: Needs updating again when Celery/kombu gain RabbitMQ 4.x support; rabbitmq:3 will eventually stop receiving security patches.

2. Disable Celery's mingle boot-step in tests

Configure the Celery test app with worker_disable_mingle=True (or CELERY_WORKER_DISABLE_MINGLE=True) to skip the mingle step that performs the problematic Queue.declare.

  • Pro: Works with any RabbitMQ version.
  • Con: Changes the worker configuration under test, potentially masking real connectivity issues; requires deeper integration with pytest-celery's worker fixture.

3. Wait for an upstream Celery/kombu fix

Track celery/celery#9659 and upgrade once a version of Celery or kombu is released that avoids transient_nonexcl_queues.

  • Pro: Correct long-term resolution; no local workaround needed.
  • Con: Blocks the CI today and has no fixed timeline.

Approach 1 is the most pragmatic fix and is straightforward to revert once the upstream issue is resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions