-
RabbitMQ server fails to start if:
This behavior can be recreated in a fresh RabbitMQ environment with the following command sequence: echo > env.txt
echo "'test'" >> env.txt
export TEST_VAR=`cat env.txt`
echo NODE_PORT=9999 > /test.conf
export RABBITMQ_CONF_ENV_FILE=/test.conf
bash /opt/rabbitmq/sbin/rabbitmq-server Running this sequence in the official
Removing either the I've previously reported this issue to the Bitnami RabbitMQ project here but found that the problem seems to be in the RabbitMQ software itself. The problem appears to have started in version 3.8.4. This docker-compose file also reproduces the problem thought it behaves slightly differently and starts the server while ignoring the config file. version: '3'
services:
rabbitmq:
image: rabbitmq:latest
environment:
RABBITMQ_CONF_ENV_FILE: /test.conf
TEST_VAR: |
'test'
volumes:
- /path/to/test.conf:/test.conf:ro
command: ["bash", "/opt/rabbitmq/sbin/rabbitmq-server"] Versions:
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 13 replies
-
I must be missing something but echo > env.txt
echo "'test'" >> env.txt
export TEST_VAR=`cat env.txt`
echo NODE_PORT=9999 > /test.conf results in the following environment variable file: NODE_PORT=9999 which works like a charm. The following file NODENAME='hare@warp10' also works like a charm while it contains an apostrophe. Env variables not related to RabbitMQ are ignored: NODENAME='hare@warp10'
TEST_VAR='a' also works like a charm. So does this file which contains a trailing empty line: NODENAME='hare@warp10'
TEST_VAR='a' I don't think we are interested in supporting newlines in environment variables values. The very basic parser we have is sufficient, or this issue would be brought up over and over again. It is expected that if |
Beta Was this translation helpful? Give feedback.
-
@bradsease I cannot reproduce using several example files above. I'm afraid we need a set of specific test cases. This is not an actionable item according to the standards of our team => moved to discussions. |
Beta Was this translation helpful? Give feedback.
-
I tried to come up with a file that would fail node startup to confirm that the files are, indeed, picked up. This one does:
The message is reasonably specific and mentions the file and line number:
This is because the file is sourced with a shell before being "pre-formatted" and its contents parsed. Unlike the |
Beta Was this translation helpful? Give feedback.
-
I can't reproduce this issue using the 3.8.9 generic-unix package, Erlang 23.1.1 running on Arch Linux. Here's the script I'm using to start up RabbitMQ: https://gist.github.com/lukebakken/7ce120f566e67a6c0690ca308836d907#file-repro-sh
Complete output: https://gist.github.com/lukebakken/7ce120f566e67a6c0690ca308836d907#file-output-txt |
Beta Was this translation helpful? Give feedback.
-
Hi! I finally took the time to look at this issue. Indeed, I can reproduce the problem with the instructions from the initial comment and the docker image. I don't know what implement lf Here is how the
I will prepare a patch to fix this. |
Beta Was this translation helpful? Give feedback.
-
Here is the patch: rabbitmq/rabbitmq-common#417 @bradsease: Do you have a way to test it with your usecase? I never use Docker beside |
Beta Was this translation helpful? Give feedback.
Here is the patch: rabbitmq/rabbitmq-common#417
@bradsease: Do you have a way to test it with your usecase? I never use Docker beside
docker run -it
twice a year, so I'm not sure how to test it myself.