docker-airflow icon indicating copy to clipboard operation
docker-airflow copied to clipboard

Help Setting Up Email on Failure/Retry

Open ghost opened this issue 6 years ago • 5 comments

I have tried multiple ways to set up SMTP emails on failure while using LocalExecutor. Methods tried:

  1. Edit airflow.cfg file with proper SMTP_Host variable
  2. Add it in the Docker-Compose-LocalExecutor.yml file under environment
  3. 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`

ghost avatar Nov 05 '19 22:11 ghost

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

tonyk7440 avatar Nov 18 '19 11:11 tonyk7440

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.

ghost avatar Jan 23 '20 20:01 ghost

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.

amarupak avatar Apr 17 '20 16:04 amarupak

Hi, @amarupak, did you find a way to edit the smtp parameters?

DarwinCV avatar Jul 10 '20 06:07 DarwinCV

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

amarupak avatar Jul 10 '20 06:07 amarupak