GitHub user apoorva-01 added a comment to the discussion: How to clear an older TaskInstance and run it with the latest dag version?
Short version: those task instances have no `dag_version_id` because 2.x had no DAG versioning and the upgrade doesn't backfill it. The 3.x scheduler refuses to enqueue any TI that's missing one, which is exactly the warning you're seeing at `scheduler_job_runner.py`. It's meant to self-heal: when the run goes back through `verify_integrity`, the scheduler stamps the *latest* DagVersion onto the run's task instances and they enqueue. For that to actually fire, two things have to hold: 1. The DAG has to be parsed and active in 3.x right now, so there's a current row in the `dag_version` table to point at. If the DAG got dropped from your bundle or isn't parsing, `get_latest_version` returns nothing and there's nothing to backfill from. That's the usual reason one of these stays wedged forever instead of recovering on its own. 2. Clear the whole **DAG run**, not just the single task. Clearing one TI doesn't re-verify the run, so the null `dag_version_id` never gets filled in. Clearing the run puts it back through the scheduler, which re-verifies and backfills the version onto the tasks. One version note: the "skip and backfill instead of crashing the scheduler" handling landed in 3.1.8 ([#61813](https://github.com/apache/airflow/pull/61813)). If you're below that, upgrade first, otherwise these null-version TIs can wedge the scheduler. GitHub link: https://github.com/apache/airflow/discussions/69561#discussioncomment-17565722 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected]
