apache / apache/airflow

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

Open
#67,271 3 comments 0 reactions 0 assignees View on GitHub
area:core area:dag-bundles kind:bug needs-triage
Dominant language
Python
Stars
46.9k
Forks
17.8k
Avg merge
2d 9h
Merged PRs (30d)
472

Description

### 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`:
```ini
[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:
```ini
[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:**
```sql
-- 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

- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.