-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Invitation etc emails not being sent on the account of the code failing to generate urls #5266
Comments
I also encountered the same problem, is there a solution? |
I was in the same situation. I found a way to send an invitation email. Conclusion of this comment: Add an environment variable for email configuration to worker in docker-compose.yml. Encountered error
Run invite mail command↑ error: Flask error(excerpt) File "/usr/local/lib/python2.7/site-packages/flask/helpers.py", line 299, in url_for
raise RuntimeError('Application was not able to create a URL '
RuntimeError: Application was not able to create a URL adapter for request independent URL generation. You might be able to fix this by setting the SERVER_NAME config variable. Add I relied on the error message of this command to investigate, but was unable to resolve this Flask error. Solution: Add environment variables.In the end, however, I was able to solve the problem from a different perspective. After running $ docker-compose up
...
nginx_1 | 172.31.42.153 - - [24/May/2021:10:59:25 +0000] "POST /api/users/124/reset_password HTTP/1.1" 200 122 "https://example.com/users/124" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" "110.66.19.160"
scheduler_1 | [2021-05-24 10:59:25,960][PID:16][ERROR][ForkPoolWorker-3] task_name=redash.tasks.send_mail task_id=39f69b3c-a109-43d5-bd31-c7dd99955427 Failed sending message: Reset your password
scheduler_1 | Traceback (most recent call last):
scheduler_1 | File "/app/redash/tasks/general.py", line 58, in send_mail
scheduler_1 | mail.send(message)
scheduler_1 | File "/usr/local/lib/python2.7/site-packages/flask_mail.py", line 491, in send
scheduler_1 | with self.connect() as connection:
scheduler_1 | File "/usr/local/lib/python2.7/site-packages/flask_mail.py", line 144, in __enter__
scheduler_1 | self.host = self.configure_host()
scheduler_1 | File "/usr/local/lib/python2.7/site-packages/flask_mail.py", line 158, in configure_host
scheduler_1 | host = smtplib.SMTP(self.mail.server, self.mail.port)
scheduler_1 | File "/usr/local/lib/python2.7/smtplib.py", line 256, in __init__
scheduler_1 | (code, msg) = self.connect(host, port)
scheduler_1 | File "/usr/local/lib/python2.7/smtplib.py", line 317, in connect
scheduler_1 | self.sock = self._get_socket(host, port, self.timeout)
scheduler_1 | File "/usr/local/lib/python2.7/smtplib.py", line 292, in _get_socket
scheduler_1 | return socket.create_connection((host, port), timeout)
scheduler_1 | File "/usr/local/lib/python2.7/socket.py", line 575, in create_connection
scheduler_1 | raise err
scheduler_1 | error: [Errno 99] Cannot assign requested address
scheduler_1 | [2021-05-24 10:59:25,961][PID:16][INFO][ForkPoolWorker-3] Task redash.tasks.send_mail[39f69b3c-a109-43d5-bd31-c7dd99955427] succeeded in 0.00195795716718s: None
server_1 | [2021-05-24 10:59:28,257][PID:12][INFO][metrics] method=GET path=/health_check endpoint=redash_index status=302 content_type=text/html; charset=utf-8 content_length=311 duration=1.80 query_count=0 query_duration=0.00 Obviously, the error content is different from the test command one. In other words, the instance don't read environment variables. After run I have a question about the reliability of the test command in specific situations. My advice to anyone facing the same problem is to operate the browser and see the actual error in the log instead of checking it with a test command. I hope this will help others who are struggling with the same situation. The following is my docker-compose
env
Technical details:
|
@kijimaD thank you so much. it works! |
@kijimaD it worked, Thanks! |
@kijimaD Thank you!! It worked! |
Hello. Faced the same issue with password reset. We running redash on our own gcp server, configuring via docker-compose. Using sendgrid as mails server. Test emails works fine, but not the password reset. Here is docker compose |
Thank you very much. The |
I think this is a bug, but please correct me if I am overreaching. It may be a configuration issue but I have not found any doc to support the same.
On reading https://discuss.redash.io/t/email-invite-urls-not-generating/1044, it seems like a flask bug of not having the app context.
Issue Summary
After setting the email env variables as per https://redash.io/help/open-source/setup (for AWS SES)
works, and I receive the email as well.
But invitation emails do not get sent.
On trying this command - to send the invite directly,
I get the following error:
Steps to Reproduce
Technical details:
The text was updated successfully, but these errors were encountered: