question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

airflow throws error: airflow.exceptions.SerializedDagNotFound: DAG 'dns-basic-1min' not found in serialized_dag table

See original GitHub issue

hi,team:

i deployment airflow 2.0.2 in docker by docker-compose,airflow service start just 1 minute have many dags,bug 1 minute after dag is none,and throws bellow error:

already share dag folder to webservice/scheduler/flower container

image image

Python version: 3.8.5
Airflow version: 2.0.2
Node: airflow-webserver
-------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/.local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/root/.local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/root/.local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/root/.local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/root/.local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/root/.local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.8/site-packages/airflow/www/auth.py", line 34, in decorated
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/airflow/www/decorators.py", line 97, in view_func
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/airflow/www/decorators.py", line 60, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/airflow/www/views.py", line 1876, in tree
    dag = current_app.dag_bag.get_dag(dag_id)
  File "/usr/local/lib/python3.8/site-packages/airflow/utils/session.py", line 70, in wrapper
    return func(*args, session=session, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/airflow/models/dagbag.py", line 181, in get_dag
    self._add_dag_from_db(dag_id=dag_id, session=session)
  File "/usr/local/lib/python3.8/site-packages/airflow/models/dagbag.py", line 237, in _add_dag_from_db
    raise SerializedDagNotFound(f"DAG '{dag_id}' not found in serialized_dag table")
airflow.exceptions.SerializedDagNotFound: DAG 'dns-basic-1min' not found in serialized_dag table

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:24 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
potiukcommented, Jul 12, 2021

In a broader sense, it seems to me that when an error of “X not found” happens in most applications then no exception is generated, merely an error message stating that “X was not found”.

Absolutely agree, it this is “expected” error. I.e. if there is an action from a user or known reason/flow that leads to it, you can - and should - provide a description and remediation,

Conversely, if something is the result of some totally unexpected condition which is likely a bug in the software or bug in migration process that was not possible to handle - it is virtually impossible to predict that it can happen. The statement that “all errors “SHOULD” be handled without generating an exception” takes the simplistic point of view that every single flow in the program is checked an handled and software is bug free. Which is not only not reasonable expectation it is also virtually impossible to prove from the software engineering point of view.

1reaction
warrenstephenscommented, Jul 7, 2021

@kaxil

I found the issue!

It turns out that I had a minimized window open with the http://localhost:8080/graph?dag_id=tutorial in it! This was from doing the tutorial walkthru days prior with some other folks.

Now that I have closed that window the Airflow webserver exception no longer occurs (as shown in the screenshot above).

I guess that the minimized window was reconnecting to airflow and attempting to get info on the tutorial dag that it assumed was still serialized – causing the airflow webserver to crash with the SerializedDagNotFound message.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Airflow 2.0 - Scheduler is unable to find serialized DAG in the ...
When I check the table manually after this error, I am able to see the DAG entry in it. This issue is not...
Read more >
airflow.models.serialized_dag — Airflow Documentation
serialized_dag table is a snapshot of DAG files synchronized by scheduler. ... If the record already exists, it checks if the Serialized DAG...
Read more >
[GitHub] [airflow] warrenstephens commented on issue #15607
... on issue #15607: airflow throws error: airflow.exceptions.SerializedDagNotFound: DAG 'dns-basic-1min' not found in serialized_dag table.
Read more >
Release Notes - Apache Airflow documentation - Amazon AWS
Fix airflow db reset when dangling tables exist (#25441) ... Prevent scheduler crash when serialized dag is missing (#19113).
Read more >
Enabling and disabling DAG serialization | Cloud Composer
The web server does not process DAGs. Instead, it reads the serialized DAGs from the Airflow database. Serializing DAGs in this way reduces...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found