Hello,
After wanting to update my RabbitMQ container from 3.9.7-management to the latest 3.9-management image, I've encountered an issue that setting the environment variables `RABBITMQ_DEFAULT_USER` / `RABBITMQ_DEFAULT_PASS` do not longer work.
Error from container logs:
```
Starting broker...2022-10-01 15:29:31.030898+00:00 [info] <0.837.0> accepting AMQP connection <0.837.0> (
192.168.80.11:51834 ->
192.168.80.8:5672)
rabbitmq-1 | 2022-10-01T15:29:31.033360772Z 2022-10-01 15:29:31.032492+00:00 [error] <0.837.0> Error on AMQP connection <0.837.0> (
192.168.80.11:51834 ->
192.168.80.8:5672, state: starting):
rabbitmq-1 | 2022-10-01T15:29:31.033377193Z 2022-10-01 15:29:31.032492+00:00 [error] <0.837.0> PLAIN login refused: user 'default' - invalid credentials
rabbitmq-1 | 2022-10-01T15:29:31.033380459Z 2022-10-01 15:29:31.032733+00:00 [info] <0.837.0> closing AMQP connection <0.837.0> (
192.168.80.11:51834 ->
192.168.80.8:5672)
```
I've narrowed it down to the release
3.9.19 causing the issue (3.9.18 still works), which seems to have a "bug fix" regarding the user/definitions.
My docker compose setup is fairly straightforward:
```yml
version: '3.9'
services:
rabbitmq:
image: rabbitmq:${RABBITMQ_IMAGE_VERSION}
hostname: rabbitmq
security_opt:
- no-new-privileges:true
<<: *restart-always
environment:
RABBITMQ_DEFAULT_USER: ${MESSENGER_TRANSPORT_USER}
RABBITMQ_DEFAULT_PASS: ${MESSENGER_TRANSPORT_SECRET}
expose:
- 5672
- 15672
volumes:
- ./docker/rabbitmq/definitions.json:/etc/rabbitmq/definitions.json
- ./docker/rabbitmq/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
- rabbitmq_data:/var/lib/rabbitmq
networks:
- proxy
volumes:
rabbitmq_data:
driver: local
networks:
proxy:
external: true
```
My `definitions.json`:
```json
{
"vhosts": [
{
"name": "/"
}
],
"parameters": [],
"global_parameters": [
{
"name": "cluster_name",
"value": "rabbitmq_cs"
}
],
"policies": [],
"queues": [
{
"name": "messages_normal",
"vhost": "/",
"durable": true,
"auto_delete": false,
"arguments": {}
},
{
"name": "messages_high",
"vhost": "/",
"durable": true,
"auto_delete": false,
"arguments": {}
},
{
"name": "messages_cron",
"vhost": "/",
"durable": true,
"auto_delete": false,
"arguments": {}
},
{
"name": "messages_mail",
"vhost": "/",
"durable": true,
"auto_delete": false,
"arguments": {}
}
],
"exchanges": [
{
"name": "messages",
"vhost": "/",
"type": "direct",
"durable": true,
"auto_delete": false,
"internal": false,
"arguments": {}
}
],
"bindings": [
{
"source": "messages_normal",
"vhost": "/",
"destination": "messages",
"destination_type": "queue",
"routing_key": "*",
"arguments": {}
},
{
"source": "messages_high",
"vhost": "/",
"destination": "messages",
"destination_type": "queue",
"routing_key": "*",
"arguments": {}
},
{
"source": "messages_cron",
"vhost": "/",
"destination": "messages",
"destination_type": "queue",
"routing_key": "*",
"arguments": {}
},
{
"source": "messages_mail",
"vhost": "/",
"destination": "messages",
"destination_type": "queue",
"routing_key": "*",
"arguments": {}
}
]
}
```
My `rabbitmq.conf`
```
vm_memory_high_watermark.relative = 0.7
vm_memory_high_watermark_paging_ratio = 0.8
log.file = rabbit.log
log.dir = /var/log/rabbitmq
log.default.level = error
log.file.level = debug
log.connection.level = info
# rotate when the file reaches 10 MiB
log.file.rotation.size = 10485760
# keep up to 5 archived log files in addition to the current one
log.file.rotation.count = 5
# definitions
management.load_definitions = /etc/rabbitmq/definitions.json
```
And in the `.env` file
```
RABBITMQ_IMAGE_VERSION="3.9.19-management"
MESSENGER_TRANSPORT_USER="default"
MESSENGER_TRANSPORT_SECRET="password"
```
Additional information:
Ubuntu 20.04
Docker Compose V2.10.2
If more information is required, please let me know.
Regards,
ToshY