'Airflow 2.1.0 - DAG 'XXXXXXXX' not found in serialized_dag table

We recently upgraded from Airflow 1.10.12 to Airflow 2.1.0 and are getting issues errors like this in the UI for each of our dags.

We have upgraded the version from 1.10.12 to 1.10.15 and it was successful. Then from 1.10.15 we have upgraded to 2.1.0 and facing this issue.

File "/home/airflow/.local/lib/python3.6/site-packages/airflow/models/dagbag.py", line 249, in _add_dag_from_db
    raise SerializedDagNotFound(f"DAG '{dag_id}' not found in serialized_dag table")
airflow.exceptions.SerializedDagNotFound: DAG 'XXXXXXXX' not found in serialized_dag table


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source