Salts YAML syntax error

This has happened to me with every site I’ve setup using Trellis. So I thought I would see if anyone else runs into this issue.

When pushing my site to the production server I run ansible-playbook server.yml -e env=production. I generated the salts from and copied and pasted them into my vault.

ERROR! Syntax Error while loading YAML.

The error appears to have been in '/Users/<user>/Documents/Sites/<mywebsite>/trellis/group_vars/staging/vault.yml': line 15, column 1, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

      # Generate your keys here:
			auth_key: "13sG.YKJE=_Q4:OGTQc[BQw_ypM!2`9/ZV,p6w=mDe{m&s(<i-E.M8(^s%jmDZ^;"
^ here
This one looks easy to fix.  It seems that there is a value started
with a quote, and the YAML parser is expecting to see the line ended
with the same kind of quote.  For instance:

    when: "ok" in result.stdout

Could be written as:

   when: '"ok" in result.stdout'

Or equivalently:

   when: "'ok' in result.stdout"

Has anyone else run into the issue?

Have you tried to validate your YAML syntax?

Also, be sure that when you follow the documentation in that file (# Generate your keys here: that you grab the appropriate format.

1 Like

Here are the keys that I copied

auth_key: "ldlDO3uZDA>z(V$>H<yS-M7q]aAFZsLkBTWxMcK@qujzerWF]^Mm#;0RqlC8uFIU"
secure_auth_key: "oi6:L8kM?1.TzVo[#pP@f,Bx{F8Z/F,xghk#]Y4.q]XT-5^JozegRgGk=I+Ih7%a"
logged_in_key: "6d(7:NhyC3bP#PDR_4!MgW2fY*Z$|?cU<@td-yIgx>jM/sqp7CLrzc*StrEk_;NA"
nonce_key: "V(L245<htjl^CA%?%u.}=#c(K_xr^n|;P5.J?.IdV?mXwNC)FH^>&PuZ)Va2)4Kr"
auth_salt: "yMen@Pg{jtdp:_,Wn!#jnQ)|]+SFA!WNY(BP70wzaR+gu-j{$WmVmdvCHi3y@TQq"
secure_auth_salt: "}2vi(iN3fQAWdE;pN^Qzc?=gTCWkND%^|65M:^L8Na2;e5F;a6kXt8>bL[pc@jzV"
logged_in_salt: "f($;4HHYCZQY<p5t1pb?dv[5A@[MEfT7uqlw#(^&@ds(=ESsPQiL]x:1]}fT&Gn["
nonce_salt: ",l;athHF%fm-&x8T5QKt_zn.f&Mf={e?W?T))+k;8q35w?+6{bjckE7i84KbQ8*="

I just removed the indenting from the file and now it seems to work. But I’m getting and unreachable error now. Thats another issue but at least removing the indenting worked.

So since you’ve had some syntax issues I highly recommend ruling out further syntax issues by validating any config files you may have modified by using

I checked every thing and it checks out without indenting. If I add the indenting back in it gives an error