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.

SerializedDagNotFound - when create 1000 dags

See original GitHub issue

Apache Airflow version

2.1.3

Operating System

Linux

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

Community Helm chart 8.0.8

What happened

I have created 1000 dags like that

test_AIR10001.pytest_AIR11001.py

After wait period of 5 minutes try to open any dag and can’t. Here is an exception details: https://sentry.io/share/issue/b97fca62ccec47709e814e70deb3e4ba/

If I try do do 5 dags like that I do not have this issue.

What you expected to happen

I expect dags would be loaded to Ariflow without any issue

How to reproduce

dag code

import numpy as np
from airflow import DAG
from airflow.operators.python import PythonOperator
from datetime import datetime
from src.helpers import dag_helper

with DAG(
    dag_id=dag_helper.get_dag_id_from_path(__file__),
    schedule_interval=None,
    start_date=datetime(2021, 1, 1),
    catchup=False,
    tags=["example"]
) as dag:
    def print_array():
        """Print Numpy array."""
        a = np.arange(15).reshape(3, 5)
        print(a)
        time_wait_cuy = dag_helper.get_time_wait_cuy()
        print(time_wait_cuy)
        return time_wait_cuy


    run_this = PythonOperator(
        task_id="print_the_context",
        python_callable=print_array,
    )

Here is dag_helper

import os
from pathlib import Path


def get_time_wait_cuy():
    return os.environ['environment']


def get_dag_id_from_path(dag_file_path):
    path = Path(dag_file_path)
    stem = path.stem
    trimmed_path = Path(*path.parts[5:len(path.parts) - 1])
    prefix = str(trimmed_path).replace(os.path.sep, '_')
    return '__'.join([prefix, stem])

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
denysivanovcommented, Sep 30, 2021

@khalidmammadov I did some tests on my side and it is environmental issue on my end.

Thanks for support.

0reactions
potiukcommented, Oct 8, 2021

Well, I think It’s a long document.

Coudl you please come up with the digest of it and what is you do not expec there? What is your expectation and problems you see?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scheduler is unable to find serialized DAG in the ... - GitHub
After the "airflow.exceptions.SerializedDagNotFound: DAG 'XXX' not found in serialized_dag table" is logged, the scheduler dies.
Read more >
airflow - Which is more performant: creating 1000+ DAGs or 1 ...
I tried having a single DAG and multiple tasks with just 500 stock symbols, and the Airflow UI started becoming unresponsive to load...
Read more >
FAQ — Airflow Documentation
The scheduler creates new DagRun as it moves forward, but never goes back in ... When there are a lot (>1000) of dags...
Read more >
Enabling and disabling DAG serialization | Cloud Composer
You can enable DAG serialization for an existing environment or when creating a new environment. To disable DAG serialization, override the following ...
Read more >
High Performance Airflow Dags - Medium
Dags are created in form of Python scripts. ... Total time to process all DAG files- #files * time_each_file and Multiple DAGs (~100)...
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