Trying to use airflow's EmailOperator to send an email on
trigger_rule.ONE_FAILED and seeing error:
[2019-10-14 13:31:50,604] {configuration.py:206} WARNING - section/key
[smtp/smtp_user] not found in configTraceback (most recent call last):
File "/bin/airflow", line 27, in <module>[ args.func(args)
File "/usr/lib/python2.7/site-packages/airflow/bin/cli.py", line 392, in run
pool=args.pool,
File "/usr/lib/python2.7/site-packages/airflow/utils/db.py", line
50, in wrapper
result = func(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/airflow/models.py", line
1493, in _run_raw_task
result = task_copy.execute(context=context)
File "/usr/lib/python2.7/site-packages/airflow/operators/email_operator.py",
line 64, in execute
send_email(self.to, self.subject, self.html_content,
files=self.files, cc=self.cc, bcc=self.bcc,
mime_subtype=self.mime_subtype)
File "/usr/lib/python2.7/site-packages/airflow/utils/email.py",
line 44, in send_email
return backend(to, subject, html_content, files=files,
dryrun=dryrun, cc=cc, bcc=bcc, mime_subtype=mime_subtype)
File "/usr/lib/python2.7/site-packages/airflow/utils/email.py",
line 87, in send_email_smtp
send_MIME_email(SMTP_MAIL_FROM, recipients, msg, dryrun)
File "/usr/lib/python2.7/site-packages/airflow/utils/email.py",
line 109, in send_MIME_email
s.starttls()
File "/usr/lib64/python2.7/smtplib.py", line 643, in starttls
raise SMTPException("STARTTLS extension not supported by server.")
smtplib.SMTPException: STARTTLS
Have not changed the default airflow.cfg (other than for basic password
authentication to access the webserver) and the email portion looks like
[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 here
smtp_host = localhost
smtp_starttls = True
smtp_ssl = False
# Uncomment and set the user/pass settings if you want to use SMTP AUTH
# smtp_user = airflow
# smtp_password = airflow
smtp_port = 25
smtp_mail_from = [email protected]
Checking the port in the cfg file, it seems to be open and listening...
[rvillanueva@mapr001 queensetl_airflow]$ netstat -plnt | grep
':25'(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 127.0.0.1:25 0.0.0.0:*
LISTEN -
tcp6 0 0 ::1:25 :::*
LISTEN -
... and I am able to use the linux sendmail bash command for other process
that run on this same machine (CentOS 7).
Anyone know what could be going on here or any further debugging tips?
--
This electronic message is intended only for the named
recipient, and may
contain information that is confidential or
privileged. If you are not the
intended recipient, you are
hereby notified that any disclosure, copying,
distribution or
use of the contents of this message is strictly
prohibited. If
you have received this message in error or are not the
named
recipient, please notify us immediately by contacting the
sender at
the electronic mail address noted above, and delete
and destroy all copies
of this message. Thank you.