SMTPAuthenticationError From Discourse-Doctor On New Install

I just did a fresh install of Discourse in a Digital Ocean Droplet, and it went pretty well, but I didn’t receive the notification email when I tried to register my admin account.

I went through the Troubleshooting email, and couldn’t find the solution until I got to one of the comments that said:

The double quotes work. If you have certain characters (like backslash?) in your password you’ll need to edit the file with an editor like nano.

That, and the note in /containers/app.yml about the “#” causing issues got me wondering about my password. It contained both an underscore and a tild.

I created a new email account with only alphanumeric characters for the password, and that fixed the problem. Email now works in ./discourse-doctor, and I was able to resend and receive the notification email.

I thought it would be a good idea to share this in case anyone else ends up struggling with the SMTPAuthenticationError for no discernible reason. Try an account without any special characters in the password. :grinning:

2 Likes

I have a password with - in it, and never had the problems you got.

# makes sense because that uncomments code in yml files, from anywhere in the line: Comments begin with the number sign ( # ), can start anywhere on a line, and continue until the end of the line (YAML - Wikipedia).

1 Like

@MarcP:

Interesting. If I had been asked to guess, since the SMTP password in the app.yml file is in double quotes, I would have guessed any character but a double quote would have been okay. You have me wondering if it’s something else I did.

I’ll do some more testing with it and post back with the results.

This is what I get for being in a hurry.

I reset the DISCOURSE_SMTP_USER_NAME and DISCOURSE_SMTP_PASSWORD to the original account that gave me the SMTP authentication error, and after destroying the app, when I ran ./launcher start app I got the following error:

found unknown escape character while parsing a quoted scalar at line 67 column 28 -e LANG=en_US.UTF-8
YAML syntax error. Please check your containers/*.yml config files.

Sure enough, there was an \ in the password I didn’t notice yesterday.

To confirm, I used the new account’s email address, changed the account’s password to the failing account’s password without the \, saved it in the app.yml, and re-start the app without the error message recurring. The email test with discourse-doctor worked. Then, I created a new password with a slew of special characters but not the # or the \ and repeated the test. It worked too.

In summary, it looks like special characters are okay in the app.yml DISCOURSE_SMTP_PASSWORD field, with the exception of the number sign #, the backslash \, and probably the double quote "?

1 Like

:+1: I like it, Excellent :sunglasses: