RabbitMQ: Existing setup with different credentials
This issue occurs when a previous RabbitMQ setup already exists on the machine and was initialized with different credentials than the ones currently configured for SpaceDF.
Symptoms
- SpaceDF services fail to start or keep restarting
- Logs show RabbitMQ authentication errors such as:
ACCESS_REFUSEDauthentication failed
- Updating
RABBITMQ_DEFAULT_USERorRABBITMQ_DEFAULT_PASSdoes not fix the issue
Cause
RabbitMQ stores credentials in persistent volumes on first startup.
If RabbitMQ was previously started with different credentials:
- Updating environment variables alone is not enough
- RabbitMQ will continue using the old credentials stored in volumes
- This results in a credential mismatch between SpaceDF services and RabbitMQ
How to verify
Check if an existing RabbitMQ container or volume is present:
docker ps -a | grep rabbitmqdocker volume ls | grep rabbitmqIf RabbitMQ volumes exist, they may contain credentials from a previous setup.
Fix (reset RabbitMQ credentials)
This will remove all RabbitMQ data. Only assume safe in development or fresh setups.
Stop all SpaceDF services:
docker compose downRemove existing RabbitMQ volumes:
docker volume rm <rabbitmq_volume_name>Verify credentials in .env:
RABBITMQ_DEFAULT_USER=your_username
RABBITMQ_DEFAULT_PASS=your_passwordRestart SpaceDF:
docker compose up -dRabbitMQ will be re-initialized using the new credentials.
Notes
- Changing RabbitMQ credentials always requires resetting volumes
- Do not reuse RabbitMQ credentials across projects on the same host
- For production systems, plan credential changes carefully to avoid data loss
Last updated on