AirFlow 任务运行异常: Task is not able to be run
Posted cord
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AirFlow 任务运行异常: Task is not able to be run相关的知识,希望对你有一定的参考价值。
记录一次airflow异常排查过程:
在定时任务执行一段时间后突然出现任务无法执行了,后台woker日志显示如下提示信息:
[2018-05-25 17:22:05,068] {jobs.py:2508} INFO - Task is not able to be run
查看任务对应的执行日志:
cat /home/py/airflow-home/logs/testBashOperator/print_date/2018-05-25T00:00:00/6.log
...
[2018-05-25 17:22:05,067] {models.py:1190} INFO - Dependencies not met for <TaskInstance: testBashOperator.print_date 2018-05-25 00:00:00 [success]>,
dependency ‘Task Instance State‘ FAILED: Task is in the ‘success‘ state which is not a valid state for execution. The task must be cleared in order to be run.
根据错误提示,说明依赖任务状态失败,针对这种情况有两种解决办法:
- 使用airflow run运行task的时候指定忽略依赖task:
airflow run -A dag_id task_id execution_date
- 使用命令airflow clear dag_id进行任务清理:
airflow clear -u testBashOperator
清理之后airflow运行恢复正常.
以上是关于AirFlow 任务运行异常: Task is not able to be run的主要内容,如果未能解决你的问题,请参考以下文章
异常lockfile.AlreadyLocked: ~/airflow/airflow-scheduler.pid is already locked