Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 01FEC200C5D for ; Thu, 23 Mar 2017 17:21:47 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 008FF160B75; Thu, 23 Mar 2017 16:21:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4E8C9160B84 for ; Thu, 23 Mar 2017 17:21:46 +0100 (CET) Received: (qmail 83749 invoked by uid 500); 23 Mar 2017 16:21:44 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 83729 invoked by uid 99); 23 Mar 2017 16:21:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Mar 2017 16:21:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 549191889D9 for ; Thu, 23 Mar 2017 16:21:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.349 X-Spam-Level: X-Spam-Status: No, score=-99.349 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id T7J8pF4PLmwP for ; Thu, 23 Mar 2017 16:21:43 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 0C4DC5FD8E for ; Thu, 23 Mar 2017 16:21:43 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4B964E06C9 for ; Thu, 23 Mar 2017 16:21:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id A78D921DA2 for ; Thu, 23 Mar 2017 16:21:41 +0000 (UTC) Date: Thu, 23 Mar 2017 16:21:41 +0000 (UTC) From: "Bert Desmet (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (AIRFLOW-1033) TypeError: can't compare datetime.datetime to NoneType in prev_dagrun_dep.py MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 23 Mar 2017 16:21:47 -0000 Bert Desmet created AIRFLOW-1033: ------------------------------------ Summary: TypeError: can't compare datetime.datetime to NoneType in prev_dagrun_dep.py Key: AIRFLOW-1033 URL: https://issues.apache.org/jira/browse/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 Attachments: test_dag.py, test_dag.py.log Dear, When starting a specific new dag we get the following error: [2017-03-23 16:51:16,354] {jobs.py:354} DagFileProcessor908 ERROR - Got an exception! Propagating... Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/airflow/jobs.py", line 346, in helper pickle_dags) File "/usr/lib/python2.7/site-packages/airflow/utils/db.py", line 53, in wrapper result = func(*args, **kwargs) File "/usr/lib/python2.7/site-packages/airflow/jobs.py", line 1581, in process_file self._process_dags(dagbag, dags, ti_keys_to_schedule) File "/usr/lib/python2.7/site-packages/airflow/jobs.py", line 1174, in _process_dags self._process_task_instances(dag, tis_out) File "/usr/lib/python2.7/site-packages/airflow/jobs.py", line 905, in _process_task_instances session=session): File "/usr/lib/python2.7/site-packages/airflow/utils/db.py", line 53, in wrapper result = func(*args, **kwargs) File "/usr/lib/python2.7/site-packages/airflow/models.py", line 1116, in are_dependencies_met session=session): File "/usr/lib/python2.7/site-packages/airflow/models.py", line 1140, in get_failed_dep_statuses dep_context): File "/usr/lib/python2.7/site-packages/airflow/ti_deps/deps/base_ti_dep.py", line 94, in get_dep_statuses for dep_status in self._get_dep_statuses(ti, session, dep_context): File "/usr/lib/python2.7/site-packages/airflow/ti_deps/deps/prev_dagrun_dep.py", 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 'prev_dagrun_dep.py: 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. Bert -- This message was sent by Atlassian JIRA (v6.3.15#6346)