尝试使用AWS Simple Email Service(SES)从apache airflow发送电子邮件,但返回的错误无法帮助我解决问题。我相信这是SES中的配置问题,但我不确定要更改什么。
一般信息:
DAG的缩写代码:
...
from airflow.operators.email_operator import EmailOperator
...
email_status = EmailOperator(
task_id="sending_status_email",
to="myverifiedemail@mydomain.com",
subject="Test from SES",
html_content="Trying to send an email from airflow through SES.",
dag=dag
)
...
airflow.cfg SMTP设置:
smtp_host = email-smtp.us-east-1.amazonaws.com
smtp_starttls = True
smtp_ssl = False
smtp_user = AWSUSERKEY
smtp_password = PASSWORDFROMAWSSMTP
smtp_port = 587
smtp_mail_from = myverifiedemail@mydomain.com
尝试对starttls,ssl和端口设置进行各种更改时收到错误。
ERROR - (554, b'Transaction failed: Unsupported encoding us_ascii.')
ERROR - STARTTLS extension not supported by server.
ERROR - (SSL: WRONG_VERSION_NUMBER) wrong version number (_ssl.c:852)
答案 0 :(得分:4)
不确定其他,但是我们今天遇到了这个错误:
[
dict(
dict(zip(["id", "name", "text"], list_of_tuples[index])),
**{"value": value},
)
for index, value in enumerate(value_array)
if not (math.isnan(value))
]
这是类的ERROR - (554, b'Transaction failed: Unsupported encoding us_ascii.')
方法中的默认值,该值无效:
https://github.com/apache/airflow/blob/1.10.10/airflow/operators/email_operator.py#L63
您可以通过传递有效值(例如“ utf-8”)来解决该问题:
__init__