https://www.growthbook.io/ logo
g

gentle-jewelry-98561

10/21/2021, 4:11 PM
Hi All! I've managed to get GB set up on AWS, but I'm getting "Failed to send email".
docker compose logs
doesn't seem to show anything regarding the error message. Any suggestions on how to debug this?
f

future-teacher-7046

10/21/2021, 4:12 PM
Hi! Did you setup the EMAIL_ environment variables in AWS?
g

gentle-jewelry-98561

10/21/2021, 4:12 PM
Yes, I have them all set
f

future-teacher-7046

10/21/2021, 4:13 PM
and do you have the exact same env with docker compose?
g

gentle-jewelry-98561

10/21/2021, 4:14 PM
I'm running docker on an EC2 host because I just could not get things working in ECS
So I am setting the EMAIL_* settings in my docker-compose.yml
Copy code
- EMAIL_HOST=<http://smtp.gmail.com|smtp.gmail.com>
      - EMAIL_PORT=465
      - EMAIL_HOST_USER=redacted@multimediallc.com
      - EMAIL_HOST_PASSWORD=redacted
      - EMAIL_USE_TLS=true
      - EMAIL_ENABLED=true
f

future-teacher-7046

10/21/2021, 4:15 PM
ok, I see. What email provider are you using?
g

gentle-jewelry-98561

10/21/2021, 4:16 PM
I've also used EMAIL_PORT=587 and tried removing that option as well
I could debug it, but I don't see how to get an actual error message
f

fresh-football-47124

10/21/2021, 4:18 PM
this is when resending an invite?
g

gentle-jewelry-98561

10/21/2021, 4:18 PM
Yes, although presumably the initial send would fail again as well
I just did a new invite and it failed as well
f

future-teacher-7046

10/21/2021, 4:20 PM
Yeah, looks like we're swallowing the error in the back-end for invites.
I checked and the "forgot password" email error does not get swallowed, so if you logout and try resetting your password you should see something in the docker logs
g

gentle-jewelry-98561

10/21/2021, 4:22 PM
Email server not configured
growthbook-growthbook-1  |  | Failed to send reset password email. The reset password link for <mailto:edward@multimediallc.com|edward@multimediallc.com> is:  ...
f

future-teacher-7046

10/21/2021, 4:23 PM
Ah, I see. You are missing the
EMAIL_FROM
environment variable, which is required
We need better error messaging around email configuration
g

gentle-jewelry-98561

10/21/2021, 4:24 PM
Error: Email server not configured\n at /usr/local/src/app/packages/back-end/dist/services/email.js5419\n at Generator.next (<anonymous>)\n at /usr/local/src/app/packages/back-end/dist/services/email.js871\n at new Promise (<anonymous>)\n at __awaiter (/usr/local/src/app/packages/back-end/dist/services/email.js412)\n at sendMail (/usr/local/src/app/packages/back-end/dist/services/email.js5212)\n at Object.<anonymous> (/usr/local/src/app/packages/back-end/dist/services/email.js12015)\n at Generator.next (<anonymous>)\n at /usr/local/src/app/packages/back-end/dist/services/email.js871\n at new Promise (<anonymous>)\n at __awaiter (/usr/local/src/app/packages/back-end/dist/services/email.js412)\n at Object.sendResetPasswordEmail (/usr/local/src/app/packages/back-end/dist/services/email.js11612)\n at Object.<anonymous> (/usr/local/src/app/packages/back-end/dist/models/ForgotPasswordModel.js4927)\n at Generator.next (<anonymous>)\n at fulfilled (/usr/local/src/app/packages/back-end/dist/models/ForgotPasswordModel.js558)","type":"Error","msg":"Email server not configured"}
EMAIL_FROM is not listed as something to configure here: https://docs.growthbook.io/self-host/config
f

fresh-football-47124

10/21/2021, 4:24 PM
Did you set an EMAIL_FROM env variable?
f

future-teacher-7046

10/21/2021, 4:25 PM
OK, we'll update that. This is the code that checks if emails should be enabled.
Copy code
export function isEmailEnabled(): boolean {
  if (!EMAIL_ENABLED) return false;
  if (!EMAIL_HOST) return false;
  if (!EMAIL_PORT) return false;
  if (!EMAIL_HOST_USER) return false;
  if (!EMAIL_HOST_PASSWORD) return false;
  if (!EMAIL_FROM) return false;

  return true;
}
g

gentle-jewelry-98561

10/21/2021, 4:27 PM
Cool, thank you!
Now I'm getting
Invalid login: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 <https://support.google.com/mail/?p=BadCredentials> u3sm2685671qkj.53 - gsmtp
, which I can work through.... IT has to give me this password so we might have crossed our wires
f

future-teacher-7046

10/21/2021, 4:34 PM
Sorry about the bad docs and missing error messages. I just created a GitHub issue to fix that. https://github.com/growthbook/growthbook/issues/130
g

gentle-jewelry-98561

10/21/2021, 4:47 PM
No sweat! Thanks for helping me get it working!
I was able to resolve my last error by getting an updated password from IT, so email is working now thanks!!
f

fresh-football-47124

10/21/2021, 7:35 PM
Great. We fixed that issue by improving our docs and adding errors when there is a problem sending.
2 Views