hterik commented on issue #36920:
URL: https://github.com/apache/airflow/issues/36920#issuecomment-2114066312

   After doing the following, all these all these errors went away for us.
   
   
   1. Delete all dags from the Database that no longer exist in the dagbag, 
using `airflow dags delete` command
   2. Delete task instances in odd states, according to [this 
comment](https://github.com/apache/airflow/issues/36920#issuecomment-1973422572)
 from @Schlyterr  above.
   
      >  2. Going into Browse -> Task Instances and deleting all tasks that 
didn't have any of the following states **upstream_failed, failed, success, 
removed** (I think it was only task instances with state = **scheduled** and 
**skipped** that we deleted if I remember correctly, not sure how relevant it 
is to delete **skipped** tasks)
      > 
      >  3. Going into Browse -> Dag Runs and delete all Dag runs that had a 
state other than **failed** or **success** (Ithink we removed state = 
**running** and **queued** if I remember correctly).
   
      I didn't delete all that much, i kept running and queued, only deleted 
states that i didn't recognize at all. I can't remember exactly now but i think 
there was some oddball task in a state called "started" or "scheduled", that 
was stuck since many weeks back, which doesn't match the usual 
"queued"/"running" you normally see.
      
   
   3. Delete any task instance older than 6 months, using airflow `db clean 
--clean-before-timestamp xxx`
   4. Update Airflow from 2.7.1 to 2.9.1
   
   
   Which one of the actions above that cured the problem is not known. Maybe 
only one of them is needed.


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to