-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Description
Apache Airflow version: 1.10.10
Kubernetes version (if you are using kubernetes) (use kubectl version): not relevant
Environment: not relevant
- Cloud provider or hardware configuration: not relevant
- OS (e.g. from /etc/os-release): not relevant
- Kernel (e.g.
uname -a): not relevant - Install tools: not relevant
- Others: not relevant
What happened:
Airflow is failing to send default task failure email if message contains non-ascii characters. Relevant part from task logs:
Failed to send email to: xxx.xxx@xxx.xxx
'ascii' codec can't encode characters in position 34-35: ordinal not in range(128)
What you expected to happen:
Email to be sent successfully.
Issue is most likely caused by invalid default mime_charset in send_email utility in Airflow 1.10.10:
airflow/airflow/utils/email.py
Line 67 in 317b041
| mime_subtype='mixed', mime_charset='us-ascii', |
It is set to 'us-ascii', but I would expect 'utf-8' based on UPDATING.md and current state of master branch:
https://github.com/apache/airflow/blob/v1-10-stable/UPDATING.md#setting-utf-8-as-default-mime_charset-in-email-utils
airflow/airflow/utils/email.py
Line 52 in fddc572
| mime_subtype='mixed', mime_charset='utf-8', |
As result emails are not sent, if they contain non-ascii chars.
How to reproduce it:
Run PythonOperator task which is raising Exception with non-ascii message.
Anything else we need to know: