From e22cb3521eec98d62a479d0c86da19a931f32f81 Mon Sep 17 00:00:00 2001 From: Turan Almammadov <16321061+turanalmammadov@users.noreply.github.com> Date: Wed, 4 Mar 2026 00:58:17 +0400 Subject: [PATCH] fix: improve log messages when no plugins are loaded Previously, when no plugins were present in the plugins folder, the loading summary log was identical to a successful load. This made it hard to distinguish between an empty plugin directory and errors. Changes: - When import_errors exist: emit a WARNING listing all failing plugin paths so operators can quickly see what broke - When no plugins and no errors: emit a clear DEBUG message indicating the plugins folder is empty / contains no Airflow plugins - When plugins are loaded successfully: keep the existing debug timing message Closes #56816 Made-with: Cursor --- airflow-core/src/airflow/plugins_manager.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/airflow-core/src/airflow/plugins_manager.py b/airflow-core/src/airflow/plugins_manager.py index 6e2b94330d677..5b62aeebd7a2e 100644 --- a/airflow-core/src/airflow/plugins_manager.py +++ b/airflow-core/src/airflow/plugins_manager.py @@ -128,7 +128,16 @@ def __register_plugins(plugin_instances: list[AirflowPlugin], errors: dict[str, if not settings.LAZY_LOAD_PROVIDERS: __register_plugins(*_load_providers_plugins()) - log.debug("Loading %d plugin(s) took %.2f ms", len(plugins), timer.duration) + if import_errors: + log.warning( + "Failed to load %d plugin(s): %s", + len(import_errors), + list(import_errors.keys()), + ) + elif not plugins: + log.debug("No plugins loaded (plugins folder is empty or contains no Airflow plugins)") + else: + log.debug("Loading %d plugin(s) took %.2f ms", len(plugins), timer.duration) return plugins, import_errors