Skip to content

Record import errors on Dag bundle refresh and discovery failures - #76559

Open
meel-ayush wants to merge 1 commit into
apache:mainfrom
meel-ayush:fix-bundle-refresh-silent-failure
Open

meel-ayush wants to merge 1 commit into
apache:mainfrom
meel-ayush:fix-bundle-refresh-silent-failure

Conversation

@meel-ayush

@meel-ayush meel-ayush commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

Closes: #76552

When bundle initialization, refresh, or file discovery fails in DagFileProcessorManager (such as a git connection timeout, repository authentication failure, rate limiting, or disk permission issues), the exception was caught and logged to daemon logs, but no record was persisted to the metadata database.

Because ParseImportError received 0 records, the Airflow Web UI reported 0 import errors and displayed the environment as fully healthy, even though Dag synchronization from the bundle had halted completely.

This PR ensures bundle-level refresh and discovery failures are persisted to the metadata database:

  • Records and updates ParseImportError for the affected bundle when bundle.initialize(), bundle.refresh(), or _find_files_in_bundle() raises an unhandled exception.
  • Persists the failure timestamp and full stacktrace, making bundle sync errors visible on the UI dashboard and in the DAG Bundles import error column.
  • Automatically purges the bundle-level ParseImportError once a subsequent bundle refresh succeeds.

Tests

  • Unit tests added in airflow-core/tests/unit/dag_processing/test_manager.py:
    • test_refresh_dag_bundles_refresh_failure_records_and_clears_import_error: verifies that refresh exceptions record a ParseImportError and that subsequent successful refreshes clear the error.
    • test_refresh_dag_bundles_discovery_failure_records_import_error: verifies that file discovery exceptions record a ParseImportError.

AI Usage

  • Yes (please specify the tool below)

@yuseok89 yuseok89 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one comment.

@meel-ayush
meel-ayush force-pushed the fix-bundle-refresh-silent-failure branch from 4270551 to a4b1ded Compare November 6, 2026 08:38
@meel-ayush
meel-ayush requested a review from yuseok89 November 6, 2026 09:33
@meel-ayush
meel-ayush force-pushed the fix-bundle-refresh-silent-failure branch 2 times, most recently from 000d0d7 to 6cc9a08 Compare November 7, 2026 14:22
@meel-ayush
meel-ayush force-pushed the fix-bundle-refresh-silent-failure branch 2 times, most recently from 87d5ce2 to 2079e5e Compare November 7, 2026 17:11
@meel-ayush
meel-ayush requested a review from its-amann November 7, 2026 17:13
@meel-ayush
meel-ayush force-pushed the fix-bundle-refresh-silent-failure branch from 2079e5e to 0f75465 Compare November 7, 2026 18:29
In Airflow 3, when bundle initialization, refresh, or Dag definition discovery failed in the Dag processor manager due to network timeouts, rate limiting, or disk permission errors, the exception was logged to daemon logs but never persisted to the metadata database. As a result, the Airflow Web UI showed zero import errors and presented the environment as healthy while Dag synchronization silently halted.

Persist these failures to ParseImportError scoped to the affected bundle, allowing operators to immediately view and diagnose bundle synchronization errors from the UI dashboard and bundle listings. When subsequent bundle refreshes succeed, the associated bundle-level import error is automatically purged.
@meel-ayush
meel-ayush force-pushed the fix-bundle-refresh-silent-failure branch from 0f75465 to d4ab17a Compare November 10, 2026 11:07

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DAG Processor: bundle.refresh() network and auth failures are swallowed with 0 import errors recorded

3 participants