Tasks stuck - Task state is 'running',reported state is 'success'
Getting this error randomly. Most days it's fine today 27 tasks.
Most of my processes are subdags I have only observed this behavior in a subdag.
--------------------------------------------------------------------------------
New run starting @2016-03-19T12:34:04.530293
--------------------------------------------------------------------------------
[2016-03-19 12:34:04,563] {models.py:974} INFO - Executing <Task(SubDagOperator): load_d_state> on 2016-03-18 12:00:00
[2016-03-19 12:34:04,625] {base_executor.py:34} INFO - Adding to queue: airflow run de_core_daily.load_d_state load_d_state 2016-03-18T12:00:00 --local --pool hive_write -s 2016-03-18T12:00:00 -sd DAGS_FOLDER/de_core_daily/main.py
[2016-03-19 12:34:10,047] {celery_executor.py:67} INFO - [celery] queuing ('de_core_daily.load_d_state', 'load_d_state', datetime.datetime(2016, 3, 18, 12, 0)) through celery, queue=st
[2016-03-19 12:34:10,215] {jobs.py:802} INFO - [backfill progress] waiting: 2 | succeeded: 0 | kicked_off: 1 | failed: 0 | wont_run: 0
...
[2016-03-19 12:36:50,027] {jobs.py:802} INFO - [backfill progress] waiting: 2 | succeeded: 0 | kicked_off: 1 | failed: 0 | wont_run: 0
[2016-03-19 12:36:50,052] {base_executor.py:34} INFO - Adding to queue: airflow run de_core_daily.load_d_state check_d_state 2016-03-18T12:00:00 --local -s 2016-03-18T12:00:00 -sd DAGS_FOLDER/de_core_daily/main.py
[2016-03-19 12:36:55,026] {celery_executor.py:67} INFO - [celery] queuing ('de_core_daily.load_d_state', 'check_d_state', datetime.datetime(2016, 3, 18, 12, 0)) through celery, queue=st
[2016-03-19 12:36:55,140] {jobs.py:802} INFO - [backfill progress] waiting: 1 | succeeded: 1 | kicked_off: 2 | failed: 0 | wont_run: 0
[2016-03-19 12:37:00,073] {jobs.py:802} INFO - [backfill progress] waiting: 1 | succeeded: 1 | kicked_off: 2 | failed: 0 | wont_run: 0
[2016-03-19 12:37:05,073] {jobs.py:788} ERROR - The airflow run command failed at reporting an error. This should not occur in normal circumstances. Task state is 'running',reported state is 'success'. TI is <TaskInstance: de_core_daily.load_d_state.check_d_state 2016-03-18 12:00:00 [running]>
[2016-03-19 12:37:05,074] {jobs.py:802} INFO - [backfill progress] waiting: 1 | succeeded: 1 | kicked_off: 2 | failed: 0 | wont_run: 0
...
When this happens the task stays in a "no status" state indefinitely in the UI

I also cannot see a task instance in the airflow db (directly or through the UI)

Through the UI I cannot see the log for the task instance but I can see it on disk.
The last logged line is
[2016-03-19 12:37:00,833] {models.py:920} WARNING - Dependencies not met yet
The dependencies are in fact met. If I clear the subdag it runs fine. Also if I run the task from the UI it runs fine as well.
The same behavior has been observed in two environments one running airbnb_prod.1.6.2.3 and another running *airbnb_prod.1.6.2.10 *
Any insight would be much appreciated. Having trouble getting to the bottom of this ... This is essentially a show stopper for our production pipelines.
@syvineckruyk I don't know if it's the same issue but something similar was happening to me a few months ago -- I took a stab at it in https://github.com/airbnb/airflow/pull/569 but it was too slippery to lock down. I think the error message you're seeing is an attempt to alert you that it's happening.
In my case, Celery tasks were failing for non-airflow reasons (out of memory errors due to many simultaneous tasks in a complex subdag). The celery task would therefore be "complete" (as it terminated) but the airflow task would be running and never get updated (since the Celery post-task stuff never runs). It's been a few months since I looked at this but as a starting point, my suggestion is to see if you can diagnose any errors that would be killing the celery workers. I will try to think if there's a way to better self-correct this within Airflow.
Yeah that looks like some external kill -9 where the job could not catch the signal and record the failure.
I'd recommend adding a new elif at the pointer bellow, looking for tasks that have failed as far as the scheduler knows, but are still running, and handle the failure. I believe the task instance has a handle_failure method that sends email and puts itself in either failed or waiting_for_retry.
https://github.com/airbnb/airflow/blob/master/airflow/jobs.py#L791
@syvineckruyk I'm not sure if this is one of the issues we solved this week or not?
@jlowin I have not observed this exact behavior on any of the releases I have been running since last week. I will keep an eye out though.
I am getting a similar error in my logs:
[2016-04-28 23:33:42,720] {jobs.py:799} ERROR - The airflow run command failed at reporting an error. This should not occur in normal circumstances. Task state is 'None',reported state is 'success'. TI is <TaskInstance: test_pipeline.test_tast 2016-04-21 10:00:00 [None]>
My pipeline is now stuck. It doesnt run anymore