Docker compose and a custom config

318 views
Skip to first unread message

Eugen Zar

unread,
Oct 3, 2022, 3:22:15 PM10/3/22
to rabbitmq-users
Hi, 

I created the following and simple docker-compose file: 
rabbitmq:
hostname: rabbitmq
container_name: RabbitMQ
image: rabbitmq:3.11.0-management-alpine
volumes:
- "./rabbitmq/config/custom.conf:/etc/rabbitmq/conf.d/custom.conf"
- "./rabbitmq/config/definitions.json:/etc/rabbitmq/definitions.json"
networks:
- backend


My custom.conf file looks like this: 
default_pass = guest
default_user = guest


When running the docker-compose up command, the container is created, but rabbitmq is not starting because of this error: 
2022-10-03 19:13:38.787413+00:00 [error] <0.132.0> Error parsing configuration:
2022-10-03 19:13:38.810851+00:00 [error] <0.132.0>   - Syntax error in /etc/rabbitmq/conf.d/custom.conf after line 1 column 1, parsing incomplete
2022-10-03 19:13:38.810892+00:00 [error] <0.132.0> Are these files using the Cuttlefish format?

BOOT FAILED
===========
Error during startup: {error,failed_to_parse_configuration_file}

2022-10-03 19:13:38.813985+00:00 [error] <0.132.0>
2022-10-03 19:13:38.813985+00:00 [error] <0.132.0> BOOT FAILED
2022-10-03 19:13:38.813985+00:00 [error] <0.132.0> ===========
2022-10-03 19:13:38.813985+00:00 [error] <0.132.0> Error during startup: {error,failed_to_parse_configuration_file}
2022-10-03 19:13:38.813985+00:00 [error] <0.132.0>

There are no strange character or anything else in the config file. What is the problem and how to solve it? 

Luke Bakken

unread,
Oct 5, 2022, 10:52:08 AM10/5/22
to rabbitmq-users
Hello,

This looks correct. So I can test with your exact same files, please create a git repository (GitHub, GitLab, etc) that I can clone to use the same data.

To reproduce your issue, I should only have to run these commands:

cd your-repo
docker compose up

Thank you,
Luke

Eugen Zar

unread,
Oct 11, 2022, 2:24:47 PM10/11/22
to rabbitmq-users
Hi Luke, 

thanks for the response and sorry for the late answer from my side.
Here is the repo: 

Best regards, 
Eugen

Luke Bakken

unread,
Oct 17, 2022, 12:10:24 PM10/17/22
to rabbitmq-users
Hi Eugen,

Your custom.conf file starts with a UTF-8 BOM, which is not allowed:

$ xxd custom.conf
00000000: efbb bf64 6566 6175 6c74 5f70 6173 7320  ...default_pass
00000010: 3d20 6775 6573 740a 6465 6661 756c 745f  = guest.default_
00000020: 7573 6572 203d 2067 7565 7374 0a         user = guest.

Eugen Zar

unread,
Oct 17, 2022, 2:29:43 PM10/17/22
to rabbitmq-users
Hi Luke, 

many thanks for the response. Never thought about the "BOM" part. Is this somewhere documented? 

Best regards,
Eugen

Luke Bakken

unread,
Oct 17, 2022, 7:48:12 PM10/17/22
to rabbitmq-users
It's not documented.

It's very rare for this to be an issue but I may add support for a BOM mark to the library that parses the file - https://github.com/Kyorai/cuttlefish

On Monday, October 17, 2022 at 11:29:43 AM UTC-7 jeka...@gmail.com wrote:
Hi Luke, 

Luke Bakken

unread,
Oct 17, 2022, 10:57:07 PM10/17/22
to rabbitmq-users
https://github.com/Kyorai/cuttlefish/issues/32

If you'd like to watch that issue, you can see when the next version ships, then see when it's incorporated into RabbitMQ.

Thanks,
Luke

Reply all
Reply to author
Forward
0 new messages