Skip to content

DAGs from removed DAG bundles remain visible in UI after bundle removal #67271

@ktaborski

Description

@ktaborski

Under which category would you file this issue?

Airflow Core

Apache Airflow version

3.2.1

What happened and how to reproduce it?

When a DAG bundle is removed from the dag_bundle_config_list configuration, the DAGs that belonged to that bundle remain visible and active in the Airflow UI. They should be automatically deactivated (marked as stale) when their parent bundle is removed from configuration.

Steps to Reproduce

  1. Configure a DAG bundle in airflow.cfg:

    [dag_processor]
    dag_bundle_config_list = [
        {
            "name": "ex_dag_bundle",
            "classpath": "airflow.dag_processing.bundles.local.LocalDagBundle",
            "kwargs": {"path": "/path/to/dags"}
        }
    ]
  2. Start the DAG processor and verify DAGs from ex_dag_bundle appear in the UI

  3. Remove the bundle from configuration:

    [dag_processor]
    dag_bundle_config_list = []
  4. Restart the DAG processor

Expected Behavior

Actual Behavior

After removing bundle ex_dag_bundle from config and restarting the DAG processor:

Logs show bundle was disabled:

2026-05-21T03:49:11.262670Z [warning] DAG bundle ex_dag_bundle is no longer found in config and has been disabled
2026-05-21T03:49:11.264931Z [info] Deleted import errors for bundle ex_dag_bundle which is no longer configured

But database shows both bundle and DAGs remain active:

-- Bundle table shows active = true (should be false)
SELECT name, active FROM dag_bundle WHERE name = 'ex_dag_bundle';
-- Result: ex_dag_bundle | true

-- DAG table shows is_stale = false (should be true)
SELECT dag_id, is_stale, bundle_name FROM dag WHERE bundle_name = 'ex_dag_bundle';
-- Result: ex_dag_name | false | ex_dag_bundle

Summary:

  • ❌ Bundle active flag remains true in database (despite log saying it was disabled)
  • ❌ DAGs is_stale flag remains false in database
  • ❌ DAGs continue to appear as active in the UI

What you think should happen instead?

  • The DAG bundle should be marked as inactive in the database
  • All DAGs belonging to that bundle should be automatically deactivated (marked as stale)
  • The DAGs should no longer appear in the UI (or appear as inactive/stale)

Operating System

EKS bottlerocket

Deployment

Official Apache Airflow Helm Chart

Apache Airflow Provider(s)

No response

Versions of Apache Airflow Providers

No response

Official Helm Chart version

1.18.0

Kubernetes Version

No response

Helm Chart configuration

No response

Docker Image customizations

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

    area:corekind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yet

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions