widewing opened a new issue #13901: URL: https://github.com/apache/airflow/issues/13901
I recently upgraded my Airflow version from 1.10.10 to 2.0.0, and noticed the scheduler are failing and exiting after upgrade. After checking the log, it's suggest the duplicated entry for records in `dag_run` table. It tries to insert dag runs already executed before the upgrade. After some digging, I found it related to how the scheduler calculate the next execution_date: it picks the last dag_run with `run_type` of scheduled, however the new `DagRunType.SCHEDULED` is not the same as "scheduled" as previously was. as `DagRunType` is an enum type, `DagRunType.SCHEDULED` is actually converted to "DagRunType.SCHEDULED" not "scheduled". It looks like not an intended design but a mistake. change of `DagRunType.SCHEDULED` to `DagRunType.SCHEDULED.value` will simply solve this issue. https://github.com/apache/airflow/blob/ab5f770bfcd8c690cbe4d0825896325aca0beeca/airflow/jobs/scheduler_job.py#L1559-L1568 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
