# Discourse-setup generates malformed YAML if password contains ':'

**URL:** https://meta.discourse.org/t/discourse-setup-generates-malformed-yaml-if-password-contains/45247
**Category:** Bug
**Created:** [2016年六月4日 13:41 UTC](https://meta.discourse.org/t/discourse-setup-generates-malformed-yaml-if-password-contains/45247 "2016-06-04T13:41:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![csirac2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csirac2/32/61088_2.png) [@csirac2](https://meta.discourse.org/u/csirac2)
#### Post date: [2016年六月4日 13:41 UTC](https://meta.discourse.org/t/discourse-setup-generates-malformed-yaml-if-password-contains/45247/1 "2016-06-04T13:41:33Z")

</div>

During initial `./discourse-setup` using `1475ee4554ba7895cf3410f6181bb96155c7b5b3` the `DISCOURSE_SMTP_PASSWORD` contained a full-colon character `:` which resulted in an error after pulling down the docker image:

> (): mapping values are not allowed in this context at line 62 column 42 -e LANG=en\_US.UTF-8  
> YAML syntax error. Please check your containers/\*.yml config files.

That was the final two lines of output from the script. I fixed app.yaml by simply quoting the `DISCOURSE_SMTP_PASSWORD` value.

`./discourse-setup` should probably be properly quoting all of these yaml responses anyway.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2016年六月4日 22:49 UTC](https://meta.discourse.org/t/discourse-setup-generates-malformed-yaml-if-password-contains/45247/2 "2016-06-04T22:49:06Z")

</div>

Yes, excellent point! I was afraid to put this in the raw YAML file to avoid the implied “who’s on first” problem of whether double quotes are part of the password or not. This came up before and we discussed it, but decided to leave it as a comment.

https://www.youtube.com/embed/kTcRRaXV-fg?feature=oembed&wmode=opaque

But within `discourse-setup` adding double quotes around the `DISCOURSE_SMTP_PASSWORD` is a no-brainer and can be automated, so I’ve done that:

[https://github.com/discourse/discourse\_docker/commit/6a9f41e996d3c2b10f1151159b54bfd4f649e10d](https://github.com/discourse/discourse_docker/commit/6a9f41e996d3c2b10f1151159b54bfd4f649e10d)

(I don’t think the other fields will typically contain any unusual characters and thus don’t benefit from this kind of protection like password field does.)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2016年六月4日 22:52 UTC](https://meta.discourse.org/t/discourse-setup-generates-malformed-yaml-if-password-contains/45247/3 "2016-06-04T22:52:32Z")

</div>


