You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Divya Bairavarasu (JIRA)" <ji...@apache.org> on 2016/05/03 18:01:12 UTC
[jira] [Closed] (AIRFLOW-36) Email on failure not working Airflow
[ https://issues.apache.org/jira/browse/AIRFLOW-36?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Divya Bairavarasu closed AIRFLOW-36.
------------------------------------
Resolution: Fixed
> Email on failure not working Airflow
> ------------------------------------
>
> Key: AIRFLOW-36
> URL: https://issues.apache.org/jira/browse/AIRFLOW-36
> Project: Apache Airflow
> Issue Type: Bug
> Environment: CentOS
> Reporter: Divya Bairavarasu
>
> Following is my code:
> from airflow import DAG
> from airflow.operators import BashOperator
> from datetime import datetime, timedelta
> default_args = {
> 'owner': 'airflow',
> 'start_date': datetime.now()-timedelta(minutes=5),
> 'email': ['divya.h@gmail.com'],
> 'email_on_failure': True,
> 'email_on_retry': True,
> 'sla':datetime.now()-timedelta(seconds=60),
> 'retries': 1,
> 'retry_delay': timedelta(seconds=60)
> }
> dag = DAG('mysql_test', default_args=default_args)
> hdfs_copy = """
> cd /root/airflow/scripts/
> ./sqoop_import.sh
> """
> # Importing the data from Mysql table to HDFS
> task1 = BashOperator(
> task_id= 'hdfs_copy',
> bash_command=hdfs_copy,
> dag=dag
> )
> # Inserting the data from Hive external table to the target mysql table
> mysql_copy= """
> cd /root/airflow/scripts/
> ./sqoop_export.sh
> """
> task2 = BashOperator(
> task_id= 'mysql_copy',
> bash_command=mysql_copy,
> depends_on_past=True,
> dag=dag
> )
> # defining the job dependency
> task2.set_upstream(task1)
> The task1 and task2 both fail.I am not receiving any email alerts
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)