Issue Summary

I have been trying to get re:dash to send alert emails and I can not seem to get it to work. I get the following error:

worker_1 | error: [Errno 99] Cannot assign requested address

But if I telnet to that ip/port from my machine I get the SMTP server without any issues.

Technical details:

  • Redash Version: 4.0.1
  • Browser/OS: macOSX
  • How did you install Redash: Git clone, then Docker.

I see the following in the screen dump:
worker_1 | [2018-05-11 18:39:39,937][PID:13][ERROR][Worker-2] Mail send error.
worker_1 | Traceback (most recent call last):
worker_1 | File “/app/redash/destinations/email.py”, line 51, in notify
worker_1 | mail.send(message)
worker_1 | File “/usr/local/lib/python2.7/dist-packages/flask_mail.py”, line 491, in send
worker_1 | with self.connect() as connection:
worker_1 | File “/usr/local/lib/python2.7/dist-packages/flask_mail.py”, line 144, in enter
worker_1 | self.host = self.configure_host()
worker_1 | File “/usr/local/lib/python2.7/dist-packages/flask_mail.py”, line 158, in configure_host
worker_1 | host = smtplib.SMTP(self.mail.server, self.mail.port)
worker_1 | File “/usr/lib/python2.7/smtplib.py”, line 256, in init
worker_1 | (code, msg) = self.connect(host, port)
worker_1 | File “/usr/lib/python2.7/smtplib.py”, line 316, in connect
worker_1 | self.sock = self._get_socket(host, port, self.timeout)
worker_1 | File “/usr/lib/python2.7/smtplib.py”, line 291, in _get_socket
worker_1 | return socket.create_connection((host, port), timeout)
worker_1 | File “/usr/lib/python2.7/socket.py”, line 575, in create_connection
worker_1 | raise err
worker_1 | error: [Errno 99] Cannot assign requested address
worker_1 | [2018-05-11 18:39:39,943][PID:13][ERROR][Worker-2] Mail send error.
worker_1 | Traceback (most recent call last):
worker_1 | File “/app/redash/destinations/email.py”, line 51, in notify
worker_1 | mail.send(message)
worker_1 | File “/usr/local/lib/python2.7/dist-packages/flask_mail.py”, line 491, in send
worker_1 | with self.connect() as connection:
worker_1 | File “/usr/local/lib/python2.7/dist-packages/flask_mail.py”, line 144, in enter
worker_1 | self.host = self.configure_host()
worker_1 | File “/usr/local/lib/python2.7/dist-packages/flask_mail.py”, line 158, in configure_host
worker_1 | host = smtplib.SMTP(self.mail.server, self.mail.port)
worker_1 | File “/usr/lib/python2.7/smtplib.py”, line 256, in init
worker_1 | (code, msg) = self.connect(host, port)
worker_1 | File “/usr/lib/python2.7/smtplib.py”, line 316, in connect
worker_1 | self.sock = self._get_socket(host, port, self.timeout)
worker_1 | File “/usr/lib/python2.7/smtplib.py”, line 291, in _get_socket
worker_1 | return socket.create_connection((host, port), timeout)
worker_1 | File “/usr/lib/python2.7/socket.py”, line 575, in create_connection
worker_1 | raise err
worker_1 | error: [Errno 99] Cannot assign requested address

I have in the docker file:

environment:
REDASH_LOG_LEVEL: “INFO”
REDASH_MAIL_PORT: “1025”
REDASH_MAIL_DEFAULT_SENDER: "no-reply@example.com"
REDASH_MAIL_SERVER: “Server IP Here”

Any suggestions?

did you try using 127.0.0.1 or localhost rather then physical ip? (no expert here)

Yes, I tried 127.0.0.1, the machines ip, and localhost. Same result each time.

Yes, tried all three.

Had similar issue. Turned out, environment variables for mail/smtp were set up on the redash server but not on the worker servers.

1 Like