Skip to content

Don't fail API server startup when a plugin uses an unknown team - #69976

Merged
pierrejeambrun merged 1 commit into
apache:mainfrom
astronomer:warn-invalid-plugin-team
Jul 16, 2026
Merged

pierrejeambrun merged 1 commit into
apache:mainfrom
astronomer:warn-invalid-plugin-team

Conversation

@pierrejeambrun

@pierrejeambrun pierrejeambrun commented Jul 16, 2026 •

Copy link
Copy Markdown
Member

Follow-up of #69502.

#69502 added team validation for plugins, but a single plugin referencing a team that does not exist raised during app creation — so the whole API server, and every other plugin, failed to boot. A misconfigured plugin should be surfaced, not fatal, the same way other plugin load errors are.

The team check now records each offending plugin as a plugin import error (surfaced in the plugins API and UI, like any other plugin load failure) and logs a warning instead of raising. It also runs from get_fastapi_plugins() — which init_plugins() already calls — so validation happens automatically wherever plugins are mounted, rather than relying on a separate validate_plugin_teams() call that a caller could forget.

Only reached from the API server and the airflow plugins CLI (never workers/dag-processor/triggerer), and the DB is only touched when [core] multi_team is enabled.


Before

Screenshot 2026-07-16 at 18 00 20

After

Screenshot 2026-07-16 at 17 55 20 Screenshot 2026-07-16 at 17 55 36
Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

Team validation for plugins raised during app creation when any plugin referenced
a team that does not exist, so a single misconfigured plugin stopped the whole API
server — and every other plugin — from booting. A misconfigured plugin should be
surfaced, not fatal, the same way other plugin load errors are.

The team check now records each offending plugin as a plugin import error (surfaced
in the plugins API and UI) and logs a warning instead of raising, and runs from
get_fastapi_plugins() so it happens automatically wherever plugins are mounted.

Follow-up of apache#69502.
@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:plugins labels Jul 16, 2026
@pierrejeambrun
pierrejeambrun marked this pull request as ready for review July 16, 2026 15:53
@pierrejeambrun

Copy link
Copy Markdown
Member Author

cc: @vincbeck @o-nikolas

@pierrejeambrun
pierrejeambrun merged commit f1e7440 into apache:main Jul 16, 2026
110 of 119 checks passed
@pierrejeambrun
pierrejeambrun deleted the warn-invalid-plugin-team branch July 16, 2026 19:13
@o-nikolas

Copy link
Copy Markdown
Contributor

Hey, thanks for the PR @pierrejeambrun we definitely talked about this and @vincbeck will be happy you decided to change this 😄

Many other components in Airflow fail to start if things are misconfigured (related to teams and otherwise). So the thinking was the user will have to restart the API server anyway and we should not start in a bad state. I hear the reasoning that it's just a plugin and it's fine to start in that failed state. The plan was to see how users feel about it and pivot if needed 🙂

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

Labels

area:API Airflow's REST/HTTP API area:plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants