In Apache Airflow Tool, DAG wont run due to Duplicate Entry Problem in task_instance table

喜你入骨 提交于 2019-12-11 15:52:16

问题


Today all day i have been getting this error in the scheduler of Airflow.

sqlalchemy.exc.IntegrityError: (_mysql_exceptions.IntegrityError) (1062, "Duplicate entry '%' fir key 'PRIMARY')")

Because of this the Airflow Scheduler would stop and every time i ran this had the same problem


回答1:


This is due to MySQL's ON UPDATE CURRENT_TIMESTAMP and this is posted in JIRA of Airflow :

https://issues.apache.org/jira/projects/AIRFLOW/issues/AIRFLOW-3045?filter=allopenissues

I fixed this by altering the table to

alter table `task_instance` change `execution_date` `execution_date` TIMESTAMP(6) not null DEFAULT CURRENT_TIMESTAMP(6);


来源:https://stackoverflow.com/questions/52859113/in-apache-airflow-tool-dag-wont-run-due-to-duplicate-entry-problem-in-task-inst

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!