docker-airflow
docker-airflow copied to clipboard
Help Setting Up Email on Failure/Retry
I have tried multiple ways to set up SMTP emails on failure while using LocalExecutor. Methods tried:
- Edit airflow.cfg file with proper SMTP_Host variable
- Add it in the Docker-Compose-LocalExecutor.yml file under environment
- Add it as environment variables in entrypoint.sh
`export
AIRFLOW_HOME
AIRFLOW__CELERY__BROKER_URL
AIRFLOW__CELERY__RESULT_BACKEND
AIRFLOW__CORE__EXECUTOR
AIRFLOW__CORE__FERNET_KEY
AIRFLOW__CORE__LOAD_EXAMPLES
AIRFLOW__CORE__SQL_ALCHEMY_CONN
AIRFLOW__SMTP__SMTP_HOST
AIRFLOW__SMTP__SMTP_PORT \
if [ "$AIRFLOW__SMTP__SMTP_HOST" != "smtp_hostname" ]; then AIRFLOW__SMTP__SMTP_HOST="smtp_hostname" AIRFLOW__SMTP__SMTP_PORT=25 fi`
Hi @emauser2,
I have this set up, only needed to change the airflow.cfg file at this code block:
https://github.com/puckel/docker-airflow/blob/c6547079fef5b06ace9165e6b516c95a85cd0f16/config/airflow.cfg#L321-L332
Thanks @tonyk7440 . Did this work for you using the LocalExecutor .yml file? When I run the command to start the container it still shows all the default settings in the .cfg file.
Hi @emauser2,
did you get through this issue? I have tried editing the .cfg file but it still shows default parameters on the container. I have tried using the environmental variables in .yml file and still have the same issue.
Hi, @amarupak, did you find a way to edit the smtp parameters?
Hi @DarwinCV, you need to mount the .cfg file in the .yml file, and also I have used yahoo SMTP service and it worked. Gmail has lot of security steps that wasn't working for me