airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bert Desmet (JIRA)" <>
Subject [jira] [Created] (AIRFLOW-1033) TypeError: can't compare datetime.datetime to NoneType in
Date Thu, 23 Mar 2017 16:21:41 GMT
Bert Desmet created AIRFLOW-1033:

             Summary: TypeError: can't compare datetime.datetime to NoneType in
                 Key: AIRFLOW-1033
             Project: Apache Airflow
          Issue Type: Bug
          Components: DagRun
    Affects Versions: Airflow 1.8
         Environment: Centos 7; 
db: PostgreSQL 9.5
python version: 2.7
Installation via pip
            Reporter: Bert Desmet
            Priority: Critical


When starting a specific new dag we get the following error:
[2017-03-23 16:51:16,354] {} DagFileProcessor908 ERROR - Got an exception! Propagating...
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/airflow/", line 346, in helper
  File "/usr/lib/python2.7/site-packages/airflow/utils/", line 53, in wrapper
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/airflow/", line 1581, in process_file
    self._process_dags(dagbag, dags, ti_keys_to_schedule)
  File "/usr/lib/python2.7/site-packages/airflow/", line 1174, in _process_dags
    self._process_task_instances(dag, tis_out)
  File "/usr/lib/python2.7/site-packages/airflow/", line 905, in _process_task_instances
  File "/usr/lib/python2.7/site-packages/airflow/utils/", line 53, in wrapper
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/airflow/", line 1116, in are_dependencies_met
  File "/usr/lib/python2.7/site-packages/airflow/", line 1140, in get_failed_dep_statuses
  File "/usr/lib/python2.7/site-packages/airflow/ti_deps/deps/", line 94, in
    for dep_status in self._get_dep_statuses(ti, session, dep_context):
  File "/usr/lib/python2.7/site-packages/airflow/ti_deps/deps/", line 47,
in _get_dep_statuses
    if dag.previous_schedule(ti.execution_date) < ti.task.start_date:
TypeError: can't compare datetime.datetime to NoneType

I have added some debug code to the file '
dag = ti.task.dag
        print 'Start dates:'
        print 'previous_exection_date: %s'%(dag.previous_schedule(ti.execution_date))
        print 'current start date: %s'%(ti.task.start_date)
        if dag.catchup:
            if dag.previous_schedule(ti.execution_date) < ti.task.start_date:

And this is the output I get:
Start dates:
previous_exection_date: None
current start date: 2017-03-19 00:00:00

I think it is normall that the previous_exection_date is null, since it is the first time
this dag is being run. But why is the start_date of the dag important, and not the start date
of the run? 

I have the feeling the cause is the 'schedule_interval', which is set to None. 

Please find an example and it's log file as an attachment to this mail. 


This message was sent by Atlassian JIRA

View raw message