airflow-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Jurney <>
Subject Simple Airflow BashOperators run but can't be scheduled or un-paused
Date Tue, 16 May 2017 20:46:34 GMT
We have tasks that run, but we can't get them to run as scheduled or to

The code for the task looks like this:

# Run the API worker every 5 minutes
api_worker_dag = DAG(

# Run the API worker[
api_worker_task = BashOperator(
    bash_command="""python {{ params.base_path
}}/agl-p2p-api-worker/site/ {{ ds }}""",
        "base_path": project_home

We run this command: airflow unpause agl_p2p_api_worker_dag

And we see this error:

[2017-05-16 20:26:48,722] {} INFO - Heartbeating the process
[2017-05-16 20:26:48,723] {} INFO - Processor for
/root/airflow/dags/ finished
[2017-05-16 20:26:48,723] {} WARNING - Processor for
/root/airflow/dags/ exited with return code 1. See
/root/airflow/logs/scheduler/2017-05-16/ for details.
[2017-05-16 20:26:48,726] {} INFO - Started a process
(PID: 110) to generate tasks for /root/airflow/dags/ - logging into
[2017-05-16 20:26:48,727] {} INFO - Heartbeating the executor
[2017-05-16 20:26:48,727] {} INFO - Heartbeating the scheduler
Process DagFileProcessor19-Process:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/multiprocessing/", line 249, in
  File "/opt/conda/lib/python3.6/multiprocessing/", line 93, in
    self._target(*self._args, **self._kwargs)
  File "/opt/conda/lib/python3.6/site-packages/airflow/", line 346,
in helper
  File "/opt/conda/lib/python3.6/site-packages/airflow/utils/", line
53, in wrapper
    result = func(*args, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/airflow/", line 1585,
in process_file
    self._process_dags(dagbag, dags, ti_keys_to_schedule)
  File "/opt/conda/lib/python3.6/site-packages/airflow/", line 1174,
in _process_dags
    dag_run = self.create_dag_run(dag)
  File "/opt/conda/lib/python3.6/site-packages/airflow/utils/", line
53, in wrapper
    result = func(*args, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/airflow/", line 807,
in create_dag_run
    else max(next_run_date, dag.start_date))
TypeError: can't compare offset-naive and offset-aware datetimes

Note that we can run/schedule the example DAGs from the CLI, and our DAGs
are very closely derived from the examples, so we don't know what to do!

For instance we can run:

docker@airflow:/mnt/airflow$ airflow run agl_p2p_api_worker_dag
api_worker_task 2017-01-01
[2017-05-16 20:44:41,046] {} INFO - Using executor
Sending to executor.
[2017-05-16 20:44:43,274] {} INFO - Using executor
Logging into:

And there are no errors. We are sure the scheduler is running and the
webserver is running. The airflow run/test commands work, but we get this
same error above when we click the activate button on the web app or
unpause the DAG from the CLI. We have wondered if our start date has to be
in the future maybe? We don't know.

Any help would be appreciated. Thanks!

Russell Jurney @rjurney <> LI <> FB

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message