Skip to content

airflow.exceptions.SerializedDagNotFound: DAG 'DAG_Name' not found in serialized_dag table #21070

@Praveentikkani

Description

@Praveentikkani

Apache Airflow version

2.1.2

What happened

We had restarted Airflow scheduler. After restart, we suddenly saw all our DAG's were missing from the UI. When we go to old tasks from task_instaces page & look at the old task it says this error.

Something bad has happened.
Please consider letting us know by creating a bug report using GitHub.

Python version: 3.8.11
Airflow version: 2.1.2
Node: airflow-web-77b556776d-wrmt9

Traceback (most recent call last):
File "/opt/bitnami/airflow/venv/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/opt/bitnami/airflow/venv/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/opt/bitnami/airflow/venv/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/opt/bitnami/airflow/venv/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/opt/bitnami/airflow/venv/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/bitnami/airflow/venv/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/www/auth.py", line 34, in decorated
return func(*args, **kwargs)
File "/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/www/decorators.py", line 97, in view_func
return f(*args, **kwargs)
File "/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/www/decorators.py", line 60, in wrapper
return f(*args, **kwargs)
File "/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/session.py", line 70, in wrapper
return func(*args, session=session, **kwargs)
File "/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/www/views.py", line 2156, in graph
dag = current_app.dag_bag.get_dag(dag_id)
File "/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/utils/session.py", line 70, in wrapper
return func(*args, session=session, **kwargs)
File "/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/models/dagbag.py", line 186, in get_dag
self._add_dag_from_db(dag_id=dag_id, session=session)
File "/opt/bitnami/airflow/venv/lib/python3.8/site-packages/airflow/models/dagbag.py", line 258, in _add_dag_from_db
raise SerializedDagNotFound(f"DAG '{dag_id}' not found in serialized_dag table")
airflow.exceptions.SerializedDagNotFound: DAG 'DAP_dbricks_user_creation' not found in serialized_dag table

What have we noticed is is_active column for all DAG's in public.dag table is set to 'false' and public.serialized_dag table is empty.

We tried to restore these 2 tables & after restoration in 1-2 mins inserted records is getting deleted from serialized_dag & it is getting updated back to false in dag table.

We also don't find .py files regarding DAG's in /opt/bitnami/airflow/dags/git_airflow-dags/ path.

What you expected to happen

No response

How to reproduce

No response

Operating System

Ubuntu (AKS)

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssue that is duplicated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions