Users reported issues with using special characters, particularly % and ", in SMTP passwords during Discourse setup, which caused YAML syntax errors in app.yml. LotusJeff encountered garbled data in the config file and resolved it by removing % from the password. pfaffman initially thought the issue was fixed but confirmed it persists with certain characters. Stephen noted that quotes in passwords can cause problems since they’re used to wrap the value in YAML. pfaffman suggested escaping quotes or avoiding them. Another user, dlukefinch, faced similar errors without special characters, possibly due to accidental input; after reinstalling and carefully re-entering details, the setup succeeded. Falco recommended using yamllint to validate YAML syntax, though dlukefinch only installed it without running the lint check. The root cause appears to be improper escaping or handling of special characters in discourse-setup, requiring manual edits or password adjustments to proceed.
I used a % as a special character in my SMTP password. This caused a control character to be created in the app.yml file that caused the following errors
(): control characters are not allowed at line 1 column 1 -e LANG=en_US.UTF-8
YAML syntax error. Please check your containers/*.yml config files.
I tried rerunning discourse-setup and it kept failing.
Eventually the data field in the app.yml file looked like this:
To resolve I had to manually edit the app.yml file to remove all the bad data and had to remove the % sign from my password. The setup than ran smoothly and allowed the setup of a new discourse install.
I use a password generator for all server related components. It uses a wide variety of special characters. Below is the password I used to setup the service that caused the problems. I have changed the actual password being used.
Thanks, Stephen. I didn’t notice the quotes on first glance.
Yeah, if you really want to use " or ' in a password, you’ll have to escape it. If you replace the quotes with something else does it work? Or, you might be able to escape them with a \, but I’m not really sure. You’ll probably need to escape them and edit app.yml by hand.
(<unknown>): control characters are not allowed at line 1 column 1 -e LANG=en_US.UTF-8
YAML syntax error. Please check your containers/*.yml config files.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
grub-pc-bin
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
python3-pathspec
The following NEW packages will be installed:
python3-pathspec yamllint
0 upgraded, 2 newly installed, 0 to remove and 21 not upgraded.
Need to get 51.8 kB of archives.
After this operation, 255 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 python3-pathspec all 0.5.5-1 [22.1 kB]
Get:2 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 yamllint all 1.10.0-1 [29.6 kB]
Fetched 51.8 kB in 0s (584 kB/s)
Selecting previously unselected package python3-pathspec.
(Reading database ... 60350 files and directories currently installed.)
Preparing to unpack .../python3-pathspec_0.5.5-1_all.deb ...
Unpacking python3-pathspec (0.5.5-1) ..........................................................]
Selecting previously unselected package yamllint...............................................]
Preparing to unpack .../yamllint_1.10.0-1_all.deb ...
Unpacking yamllint (1.10.0-1) ...#############.................................................]
Setting up python3-pathspec (0.5.5-1) ...###################...................................]
Setting up yamllint (1.10.0-1) ...########################################.....................]
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...###################################.......]
Ok, it is sorted now. Started afresh this morning and entered everything REALLY carefully. Process running and expected now. Must have entered something really minute.