Skip to content

Deleting bindings is not working #15128

@vdm24

Description

@vdm24

Describe the bug

Let's assume we have a server v4.2.1 with default configuration and activated rabbitmq_stream_management plugin.
If we create a new stream queue, an exchange, and bind them together, than we cannot delete the binding anymore.

Reproduction steps

  1. Start the server with default configuration in a docker container with "rabbit4" name and ports mapping:
docker run -p 5672:5672 -p 15672:15672 -p 5552:5552 -d --name rabbit4 rabbitmq:4.2.1-management-alpine
  1. Activate rabbitmq_stream_management and rabbitmq_stream plugins:
docker exec -it rabbit4 rabbitmq-plugins enable rabbitmq_stream_management
  1. Import this config:
{
  "queues": [
    {
      "name": "cache-invalidate",
      "vhost": "/",
      "durable": true,
      "arguments": {
        "x-queue-type": "stream",
        "x-max-age": "3h",
        "x-stream-max-segment-size-bytes": 100000,
        "x-max-length-bytes": 1000000
      }
    }
  ],
  "exchanges": [
    {
      "name": "invalidate-cache-exchange",
      "vhost": "/",
      "type": "topic",
      "durable": true
    }
  ],
  "bindings": [
    {
      "source": "invalidate-cache-exchange",
      "vhost": "/",
      "destination": "cache-invalidate",
      "destination_type": "queue",
      "routing_key": "cache.invalidate"
    }
  ]
}

using any possible way, via the web interface or with this command:

cat /path/to/config.json | docker exec -i rabbit4 rabbitmqctl import_definitions /dev/stdin
  1. Go to http://localhost:15672/#/queues/%2F/cache-invalidate
  2. Login with guest/guest
  3. Now try to delete the appended binding by pressing "Unbind" button. You will see this:
Image

and the server log has this:

2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0> Unbinding error: {'EXIT',
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>     {{case_clause,
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>          {ok,{exchange,
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>                  {resource,<<"/">>,exchange,<<"invalidate-cache-exchange">>},
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>                  topic,true,undefined,false,[],undefined,undefined,undefined,
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>                  {[],[]},
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>                  #{user => <<"rmq-internal">>}}}},
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>      [{rabbit_db_exchange,maybe_auto_delete_in_khepri,2,
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>           [{file,"rabbit_db_exchange.erl"},{line,960}]},
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>       {rabbit_db_binding,maybe_auto_delete_exchange_in_khepri,4,
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>           [{file,"rabbit_db_binding.erl"},{line,389}]},
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>       {horus,exec,2,[{file,"src/horus.erl"},{line,1026}]},
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>       {khepri_tx_adv,run,5,[{file,"src/khepri_tx_adv.erl"},{line,1013}]},
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>       {khepri_machine,apply,3,[{file,"src/khepri_machine.erl"},{line,1535}]},
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>       {khepri_machine,apply,3,[{file,"src/khepri_machine.erl"},{line,1665}]},
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>       {ra_server,apply_with,2,[{file,"src/ra_server.erl"},{line,2830}]},
2025-12-12 18:57:29.990532+00:00 [warning] <0.1998.0>       {ra_log,fold,5,[{file,"src/ra_log.erl"},{line,471}]}]}}

Expected behavior

The binding should be deleted successfully, fithout any errors.

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions