Luis
Luis

Reputation: 1475

Cloud Composer scheduler error when adding first dag

I have a DAG running on my local Airflow. I lunched Cloud Composer and wanted to move my DAGs there. When added the first DAG file the scheduler shows this error:

Traceback (most recent call last): File "/usr/local/lib/airflow/airflow/models.py", line 363, in process_file m = imp.load_source(mod_name, filepath) File "/usr/local/lib/python3.6/imp.py", line 172, in load_source module = _load(spec) File "", line 684, in _load File "", line 665, in _load_unlocked File "", line 674, in exec_module File "", line 781, in get_code File "", line 741, in source_to_code File "", line 219, in _call_with_frames_removed File "/home/airflow/gcs/dags/testdag.py", line 95 'start_date': datetime(2018, 12, 05),

This is line 95:

args = {
    'owner': 'Airflow',
    'start_date': datetime(2018, 12, 05),
    'retries': 5,
    'retry_delay': timedelta(minutes=5)
}

Never encountered this error before.

Upvotes: 1

Views: 244

Answers (2)

Nandakishore
Nandakishore

Reputation: 1011

May its the date value you gave in start_date. Try providing just 5 in datetime(2018, 12, 05) and update the DAG folder again.

Upvotes: 0

Deep Nirmal
Deep Nirmal

Reputation: 1271

If you want to run the DAG's and do catchup from the historical dates then you give the past dates as start_date

Try giving

from datetime import datetime, timedelta

args = {
    'owner': 'Airflow',
    'provide_context': True,
    'depends_on_past': False,
    'start_date': datetime.combine(datetime.today(),datetime.min.time()),
    'retries': 5,
    'retry_delay': timedelta(minutes=5)
}

Upvotes: 1

Related Questions