In my case the solution was simple but took some head scratching before it was obvious.
I am using docker environment variables in a .env file, one of my environment variables had special characters in them "%!@". This environment variable was a password variable.
Two solutions exist to my knowledge:
a) remove the special characters.
b) One can also escape environment variables using double quotes enclosed in single quotes. "''"