I have setup smtp for airflow supposedly correctly, however I'm getting an
exception that I can't figure out:

[2016-12-29 00:20:20,838] {models.py:1304} INFO - All retries failed;
marking task as FAILED
[2016-12-29 00:20:21,039] {models.py:1311} ERROR - Failed to send
email to: ['[email protected]', '[email protected]']
[2016-12-29 00:20:21,039] {models.py:1312} ERROR - 'in <string>'
requires string as left operand, not int
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/airflow/models.py",
line 1308, in handle_failure
    self.email_alert(error, is_retry=False)
  File "/usr/local/lib/python2.7/dist-packages/airflow/models.py",
line 1425, in email_alert
    send_email(task.email, title, body)
  File "/usr/local/lib/python2.7/dist-packages/airflow/utils/email.py",
line 43, in send_email
    return backend(to, subject, html_content, files=files, dryrun=dryrun)
  File "/usr/local/lib/python2.7/dist-packages/airflow/utils/email.py",
line 79, in send_email_smtp
    send_MIME_email(SMTP_MAIL_FROM, to, msg, dryrun)
  File "/usr/local/lib/python2.7/dist-packages/airflow/utils/email.py",
line 95, in send_MIME_email
    s.login(SMTP_USER, SMTP_PASSWORD)
  File "/usr/lib/python2.7/smtplib.py", line 607, in login
    (code, resp) = self.docmd(encode_cram_md5(resp, user, password))
  File "/usr/lib/python2.7/smtplib.py", line 571, in encode_cram_md5
    response = user + " " + hmac.HMAC(password, challenge).hexdigest()
  File "/usr/lib/python2.7/hmac.py", line 72, in __init__
    self.outer.update(key.translate(trans_5C))
  File "/usr/local/lib/python2.7/dist-packages/future/types/newstr.py",
line 390, in translate
    if ord(c) in table:
TypeError: 'in <string>' requires string as left operand, not int


Configuration looks like this:

[email]email_backend = airflow.utils.email.send_email_smtp
[smtp]# If you want airflow to send emails on retries, failure, and
you want to use# the airflow.utils.email.send_email_smtp function, you
have to configure an smtp# server heresmtp_host =
smtp.example.comsmtp_starttls = Truesmtp_ssl = Falsesmtp_user =
airflowsmtp_port = 25smtp_password = [password]smtp_mail_from =
[email protected]


Airflow version 1.7.1.3; thanks in advance!

-Nik

-- 


Read our founder's story. 
<https://collectivehealth.com/blog/started-collective-health/>

*This message may contain confidential, proprietary, or protected 
information.  If you are not the intended recipient, you may not review, 
copy, or distribute this message. If you received this message in error, 
please notify the sender by reply email and delete this message.*

Reply via email to