If I run test.py directly with python test.py I get the expected output:
(circus-env-var) [16:33] ~/venv/circus-env-var python test.py
INFO:root:foo$BAR
INFO:root:foo$BAR
^CTraceback (most recent call last):
File "test.py", line 14, in <module>
main()
File "test.py", line 9, in main
sleep(5)
KeyboardInterrupt
(circus-env-var) [16:34] ~/venv/circus-env-var
However if I run with the circus watcher, the $ and everything after is stripped out:
(circus-env-var) [16:34] ~/venv/circus-env-var circusd circus.ini
2022-08-08 16:34:41 circus[89891] [INFO] Starting master on pid 89891
2022-08-08 16:34:41 circus[89891] [INFO] Arbiter now waiting for commands
2022-08-08 16:34:41 circus[89891] [INFO] test started
INFO:root:foo
INFO:root:foo
^C2022-08-08 16:34:48 circus[89891] [INFO] Got signal SIG_INT
2022-08-08 16:34:48 circus[89891] [INFO] Arbiter exiting
2022-08-08 16:34:48 circus[89891] [INFO] test stopped
(circus-env-var) [16:34] ~/venv/circus-env-var
Strangely enough, if I change my env var after the $ to be lower case (or numeric), it works as expected:
(circus-env-var) [16:34] ~/venv/circus-env-var export TEST_VAR='foo$bar'
(circus-env-var) [16:35] ~/venv/circus-env-var circusd circus.ini
2022-08-08 16:35:52 circus[89999] [INFO] Starting master on pid 89999
2022-08-08 16:35:52 circus[89999] [INFO] Arbiter now waiting for commands
2022-08-08 16:35:52 circus[89999] [INFO] test started
INFO:root:foo$bar
INFO:root:foo$bar
^C2022-08-08 16:35:58 circus[89999] [INFO] Got signal SIG_INT
2022-08-08 16:35:58 circus[89999] [INFO] Arbiter exiting
2022-08-08 16:35:58 circus[89999] [INFO] test stopped
It seems like the env var is being evaluated. If I set BAR to something:
(circus-env-var) [16:35] ~/venv/circus-env-var export BAR="fizz"
(circus-env-var) [16:37] ~/venv/circus-env-var export TEST_VAR='foo$BAR'
(circus-env-var) [16:37] ~/venv/circus-env-var env | ag "(BAR|TEST_VAR)"
TEST_VAR=foo$BAR
BAR=fizz
(circus-env-var) [16:37] ~/venv/circus-env-var circusd circus.ini
2022-08-08 16:37:50 circus[90206] [INFO] Starting master on pid 90206
2022-08-08 16:37:50 circus[90206] [INFO] Arbiter now waiting for commands
2022-08-08 16:37:50 circus[90206] [INFO] test started
INFO:root:foofizz
INFO:root:foofizz
^C2022-08-08 16:37:56 circus[90206] [INFO] Got signal SIG_INT
2022-08-08 16:37:56 circus[90206] [INFO] Arbiter exiting
2022-08-08 16:37:56 circus[90206] [INFO] test stopped
but I would expect the environment variables to be passed through exactly as they are, without being evaluated. In my case, getting foo$BAR in my output.
Let me know if there is anything else I can provide.
Hi, This is a very strange issue, but one we're running into with a 3rd party secret we are unable to change. With circus
0.17.1
:If I run
test.py
directly withpython test.py
I get the expected output:However if I run with the circus watcher, the
$
and everything after is stripped out:Strangely enough, if I change my env var after the
$
to be lower case (or numeric), it works as expected:It seems like the env var is being evaluated. If I set
BAR
to something:but I would expect the environment variables to be passed through exactly as they are, without being evaluated. In my case, getting
foo$BAR
in my output.Let me know if there is anything else I can provide.