airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "raman (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AIRFLOW-1934) Unable to Launch Example DAG if ~/AIRFLOW_HOME/dags folder is empty
Date Sun, 17 Dec 2017 07:59:00 GMT
raman created AIRFLOW-1934:
------------------------------

             Summary: Unable to Launch Example DAG if ~/AIRFLOW_HOME/dags folder is empty
                 Key: AIRFLOW-1934
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1934
             Project: Apache Airflow
          Issue Type: Bug
          Components: DAG
    Affects Versions: Airflow 1.8
         Environment: RHEL
            Reporter: raman


Steps to reproduce
1. Install airflow
2. Keep the ~/{airflow_home}/dags folder empty
3. airflow initdb
4. airflow webserver and scheduler
2. Enable a DAG and trigger it manually from web UI.

Result: DAG run gets created in the dag_run table. task_instance table also get relevant enteries
but scheduler does not pick the DAG.

Workaround: Create one sample dag in the ~/{airflow_home}/dags folder and scheduler picks
it up.
The following code in jobs.py seems to be doing the trick but this code is only triggered
if there is a dag inside ~/{airflow_home}/dags folder
Function: _find_executable_task_instances
ti_query = (
           session
           .query(TI)
           .filter(TI.dag_id.in_(simple_dag_bag.dag_ids))
           .outerjoin(DR,
               and_(DR.dag_id == TI.dag_id,
                    DR.execution_date == TI.execution_date))
           .filter(or_(DR.run_id == None,
                   not_(DR.run_id.like(BackfillJob.ID_PREFIX + '%'))))
           .outerjoin(DM, DM.dag_id==TI.dag_id)
           .filter(or_(DM.dag_id == None,
                   not_(DM.is_paused)))
       )




 




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message