Skip to content

Airflow doesn't show an error when there are DAGs with the same ID #29321

Closed as not planned

Description

@keu

Apache Airflow version

2.5.1

What happened

Create two files with DAGs
Both DAGs must have the same ID
Airflow will constantly update DAG structure/code resulting in dozens of weird behaviors and errors:

  • wrong DAG visualization
  • wrong DAG code
  • errors about missing tasks from time to time

What you think should happen instead

Airflow should show an error to the user and disable both DAGs.

How to reproduce

  1. Create two files with DAGs
  2. Both DAGs should have the same ID

Operating System

Ubuntu 22.04

Versions of Apache Airflow Providers

No response

Deployment

Docker-Compose

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

Activity

  1. added
    kind:bug
    on Feb 2, 2023
  2. boring-cyborg commented on Feb 2, 2023

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template!

  3. michaelmicheal commented on Feb 6, 2023

    @michaelmicheal
    Contributor

    As I understand it, as part of DAG processing, when the scheduler sees new a definition for an existing DAG, it overwrites regardless of the path. While this is by design, my team's stakeholders face this quite a bit where user's have duplicate files, with slightly different versions of a DAG. It's not obvious, and if you rely on a GCS or S3 DAG bucket that is abstracted from users/developers, it can be hard to diagnose.

    One solution could be:
    If the DAG processor sees an existing DAG defined in a file under a different path, we re-process the file under the old path, and see if the DAG is still defined there. If the DAG is still defined under the old path, we add an import error.

    Feel free to assign this to me.

  4. eladkal commented on Feb 6, 2023

    @eladkal
    Contributor

    @michaelmicheal see #19525 (comment) for more information

    Closing as duplicate of #17861 @michaelmicheal if you'd like to work on it please comment on that issue so we can assign you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corekind:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions