Skip to content

User is able to register multiple plugins using same name #55140

Closed

Description

@atuls4441

Apache Airflow version

main (development)

If "Other Airflow 2 version" selected, which one?

No response

What happened?

User is able to register multiple FastAPI plugins using same name

On UI, only 1 plugin is visible

Image

What you think should happen instead?

No response

How to reproduce

Register 2 FastAPI plugins using same name and see no error is coming but on UI, only 1 plugin is listed

from airflow.plugins_manager import AirflowPlugin
from fastapi import FastAPI

my_app = FastAPI()

@my_app.get("/ping")
async def ping():
    return {"message": "pong"}

class MyFastAPIPlugin(AirflowPlugin):
    name = "my_fastapi_plugin"
    fastapi_apps = [
        {
            "name": "example_api",
            "app": my_app,
            "url_prefix": "/example"
        }
    ]

@my_app.get("/hello")
async def ping():
    return {"message": "Hello"}

class MyFastAPIPlugin2(AirflowPlugin):
    name = "my_fastapi_plugin"
    fastapi_apps = [
        {
            "name": "example_api",
            "app": my_app,
            "url_prefix": "/example"
        }
    ]

Operating System

Linux

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:bug
    needs-triage
    on Sep 1, 2025
  2. added
    area:UI
    on Sep 1, 2025
  3. added
    priority:medium
    affected_version:3.0
    affected_version:main_branch
    and removed
    needs-triage
    on Sep 1, 2025
  4. mandeepzemo commented on Sep 2, 2025

    @mandeepzemo
    Contributor

    I like to work on this, if open

  5. mandeepzemo commented on Sep 3, 2025

    @mandeepzemo
    Contributor

    @atul-astronomer Could you please confirm the expected behavior? The user should receive an error message when using the same plugin name. I have implemented the changes and shared the screenshot of the output below for your reference

    File duplicate_plugin.py

    from airflow.plugins_manager import AirflowPlugin
    from fastapi import FastAPI
    
    my_app = FastAPI()
    
    @my_app.get("/ping")
    async def ping():
        return {"message": "pong"}
    
    class MyFastAPIPlugin(AirflowPlugin):
        name = "my_fastapi_plugin"
        fastapi_apps = [
            {
                "name": "example_api",
                "app": my_app,
                "url_prefix": "/example"
            }
        ]
    
    @my_app.get("/hello")
    async def ping():
        return {"message": "Hello"}
    
    class MyFastAPIPlugin2(AirflowPlugin):
        name = "my_fastapi_plugin"
        fastapi_apps = [
            {
                "name": "example_api",
                "app": my_app,
                "url_prefix": "/example"
            }
        ]
    

    Screenshot

    Image
  6. added
    area:API
    and removed
    area:UI
    on Oct 1, 2025
  7. 13 remaining items

  8. potiuk commented on Mar 2, 2026

    @potiuk
    Member

    @mandeepzemo We are unassigning you from this issue as part of our updated assignment policy.

    This is not meant to discourage your contribution — quite the opposite! You are still very welcome to work on this issue and submit a PR for it. Simply comment that you are working on it and open a PR when ready.

    We found that formal assignments were not working well, as they often prevented others from contributing when the assignee was not actively working on the issue.

  9. LarytheLord commented on Mar 5, 2026

    @LarytheLord

    I started working on this and will open a PR shortly. Proposed behavior: keep loading subsequent plugins, but explicitly register duplicate plugin names as import errors (instead of only logging a warning), so the conflict is visible and actionable.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:APIarea:pluginsgood first issuekind:bugpriority:medium

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions