Can't add env var with `fly deploy --env` with a comma on it

Hi all,

we are looking to add some environment variables in our machines that include environment variables available in our CI (for instance the Git SHA of the deployment).

We need to add a comma inside the environment variable content because multiple “tags” are defined inside only one environment variable.

We are using github and our idea was to do it in the fly deploy command that will be merged with the env vars inside the fly.toml, and doing it as command arguments will allow us to inject the env vars available in the CI. However, we are facing the following error while trying to do it:

fly deploy --env TEST="a:b,c:d" 
==> Verifying app config
Error failed parsing environment: 'c:d': must be in the format NAME=VALUE

We’ve tried escaping the comma with \, \\ and % but we always receive the same error. I guess it is a problem with the flyctl when checking the contents of the arguments received. It could also be related with how bash handles strings, however it is enclosed in " so that shouldn’t be. We’ve also tested to enclose it with ' but we ended up with the same results.

Any other idea on how we could solve this? Is this the place to report this behaviour of flyctl?

1 Like

This also sounds like a bug in flyctl to me. There is a repo with issue tracker for the tool here where you can report things that are clear-cut bugs.

Following @qqwy reply, there is an active issue on Github related to this topic.