Airflow: Tasks queued but not running

泄露秘密 提交于 2019-12-01 17:25:18

have your run all the three components of airflow, namely:

airflow webserver
airflow scheduler
airflow worker

If you only run the previous two, the tasks will be queued, but not executed. airflow worker will provide the workers that actually execute the dags.

Also btw, celery 4.0.2 is not compatible with airflow 1.7 or 1.8 currently. Use celery 3 instead.

I tried to upgrade to airflow v1.8 today as well and struggled with celery and rabbitmq. What helped was the change from librabbitmq (which is used by default when just using amqp) to pyamqp in airflow.cfg

broker_url = pyamqp://rabbit:rabbit@x.x.x.x/rabbitmq_vhost

(This is where i got the idea from: https://github.com/celery/celery/issues/3675)

I realise your problem is already answered and was related to a celery version mismatch, but I've also seen tasks queue and never run because I changed the logs location to a place where the airflow service user did not have permission to write.

In the example airflow.cfg given in the question above: base_log_folder = /root/airflow/logs

I am using AWS EC2 machine and changed the logs to write to base_log_folder = /mnt/airflow/logs

In the UI there is no indication given as to why tasks are queued, it just says "unknown, all dependencies are met ..." Giving the airflow daemon/service user permission to write fixed it.

If LocalExecutor is enough option for you, you can always try to get back to it. I've heard about some problems with CeleryExecutor.

Just change executor = CeleryExecutor to executor = LocalExecutor in your airflow.cfg file (most of the time ~/airflow/airflow.cfg).

Restart scheduler and that's it!

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