Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempted to deploy, receiving "Server Error" after trying to create account/send password reset email #36

Closed
dohlin opened this issue Jan 19, 2020 · 4 comments

Comments

@dohlin
Copy link

dohlin commented Jan 19, 2020

Hey guys,

I'm getting the following error after attempting to deploy this and trying to create an account or send a password reset email:

Server error
Looks like we are having some server issues...

We are notified and will look at this issue asap!

No other info that I can find. Any thoughts as to how I can go about troubleshooting this? I followed all of the instructions...the only difference in my setup is that I'm trying to deploy this behind a reverse proxy, but I've made it so that "app.mydomain.com" successfully allows me to reach the SL login page so I think that part should be fine. Any suggestions? Thanks!

EDIT: I managed to pull logs from the mail app docker container, and here is what they say. Unfortunately I still don't know what they mean. Any thoughts?

`2020-01-19 23:54:28,947 - sl - DEBUG - 8 - server:226 - after_request - 192.168.1.25 GET /auth/forgot_password ImmutableMultiDict([]) 200

2020-01-19 23:54:30,378 - sl - DEBUG - 9 - email_utils:168 - send_email - message-id 157947807037.9.18242150938864440985@63bb1ff3494a

2020-01-19 23:54:30,383 - sl - DEBUG - 9 - email_utils:172 - send_email - Date header: Sun, 19 Jan 2020 23:54:30 -0000

2020-01-19 23:54:30,487 - sl - ERROR - 9 - server:285 - error_handler - {'[email address redacted]': (451, b'4.3.0 <[email address redacted]>: Temporary lookup failure')}

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1832, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1818, in dispatch_request
return self.view_functionsrule.endpoint
File "/code/app/auth/views/forgot_password.py", line 27, in forgot_password
send_reset_password_email(user)
File "/code/app/dashboard/views/setting.py", line 193, in send_reset_password_email
email_utils.send_reset_password_email(user.email, user.name, reset_password_link)
File "/code/app/email_utils.py", line 60, in send_reset_password_email
"reset-password.html", name=name, reset_password_link=reset_password_link
File "/code/app/email_utils.py", line 180, in send_email
smtp.sendmail(SUPPORT_EMAIL, to_email, msg_raw)
File "/usr/local/lib/python3.7/smtplib.py", line 881, in sendmail
raise SMTPRecipientsRefused(senderrs)
smtplib.SMTPRecipientsRefused: {'[email address redacted]': (451, b'4.3.0 <[email address redacted]>: Temporary lookup failure')}

2020-01-19 23:54:30,489 - sl - DEBUG - 9 - server:226 - after_request - 192.168.1.25 POST /auth/forgot_password ImmutableMultiDict([]) 500
`

EDIT: Managed to get the above figured out through a lot of digging...I had to modify the Postgres command to include '-p 5432:5432' parameter otherwise for some reason Postfix wasn't able to connect to it.

One more question now - is it possible to remove the "chat" or "cat" or "meo" or etc. before "@domainname.com" in aliases? Forgive me if this is a noobish question, but what is the purpose of this? Thanks!

@nguyenkims
Copy link
Contributor

@dohlin Glad that you have been able to debug all this out! The database needs to be reached by both containers and Postfix (which is outside of Docker) so port binding is a must. You could use another port than 5432 if this port happens to be occupied on your VM/server though.

The alias suffix like "cat", "chat" is there to avoid one person taking all "nice" aliases. This protection doesn't make sense in self-hosted SimpleLogin though, #37 adds an option to disable this suffix. Once the PR is merged, please make sure to set the DISABLE_ALIAS_SUFFIX in your config file to disable alias suffix.

@dohlin
Copy link
Author

dohlin commented Jan 20, 2020

Excellent thank you! One last question - when the PR is merged and the .env file is updated with that option, what is the best way to update the running docker container? Is it to remove the docker container and image and then simple re-pull/re-setup the container? Or is there a better way?

@nguyenkims
Copy link
Contributor

nguyenkims commented Jan 20, 2020

If you can afford some small downtimes, I would do

  1. docker pull simplelogin/app to get the latest docker image. This could take a while, depending on your network.
    1b. Update the config file to add DISABLE_ALIAS_SUFFIX option.
  2. remove all SimpleLogin containers (you don't need to remove the Postgres container) by docker rm -f sl-migration sl-app sl-email sl-cron
  3. start them again using the commands in the README.

SimpleLogin containers are down during step 2 & 3. but no email is lost as Postfix is still running.

Please note that the Docker network has changed from 1.1.1.1 to a better one (240.0.0.0), if you deploy SimpleLogin before that change, you might need to redo the network setup. Sorry about this breaking change!

@dohlin
Copy link
Author

dohlin commented Jan 20, 2020

Thank you, this all worked great. Got the docker network updated, containers removed/reassigned, & postfix main.cf file updated too. Thanks again!

@dohlin dohlin closed this as completed Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants