Compose: Suggesting escaping environment variables with double-dollar sign in error message

Created on 6 May 2016  路  4Comments  路  Source: docker/compose

Pull request #2204 documented the double-dollar sign ($$VARIABLE) escaping in the _documentation_, how about putting the same suggestion in the _error message_:

Change this:

WARNING: The VARIABLE variable is not set. Defaulting to a blank string.

To this:

WARNING: The VARIALBE variable is not set. Defaulting to a blank string.
         Did you forget to escape VARIABLE with two dollar signs like this: `$$VARIABLE`
         in your docker-compose.yml file?

Would make the error message much more useful and less misleading.

Most helpful comment

This is a great idea and would've saved me a lot of experiments with backslashes and a Google search.

All 4 comments

To me that seems very specific. There's many reasons why a variable might be unset. IMO that would be making too many assumptions.

How about providing a list of possible reasons?

How many reasons can you think of where the user would be expecting the variables to be set, but they're actually not?

This is a great idea and would've saved me a lot of experiments with backslashes and a Google search.

So uh... this is built-in now, right? I landed on this issue trying to figure out how to do it, and it works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bergtwvd picture bergtwvd  路  3Comments

bitver picture bitver  路  3Comments

maltefiala picture maltefiala  路  3Comments

DhairyashilBhosale picture DhairyashilBhosale  路  3Comments

dimsav picture dimsav  路  3Comments