shanicad opened a new issue, #68562: URL: https://github.com/apache/airflow/issues/68562
### Under which category would you file this issue? Providers ### Apache Airflow version 3.2.2 ### What happened and how to reproduce it? ### What happened The `airflow api-server`, `airflow-dag-processor` crash-loops on startup when **FastAPI 0.137.0** is installed. `apache-airflow-core` declares an **uncapped** FastAPI lower bound: ``` fastapi[standard-no-fastapi-cloud-cli]>=0.129.0 ``` (https://github.com/apache/airflow/blob/3.2.2/airflow-core/pyproject.toml#L98) So any install that doesn't apply the constraints file (custom base images, `pip install` without `-c`, etc.) resolves FastAPI to the latest `0.137.0` and breaks. FastAPI 0.137.0 changed `include_router` from **eager** inclusion (child paths concatenated with the prefix immediately) to **live/lazy** inclusion (the original nested router is kept and walked recursively). The empty-prefix + empty-path check now descends into nested routers and rejects the execution API's `health` route, which is registered with an **empty path** (`@router.get("")` in `airflow/api_fastapi/execution_api/routes/health.py`) and included via cadwyn with no prefix. Traceback: ``` File ".../airflow/api_fastapi/execution_api/app.py", line 263, in create_task_execution_api_app app.generate_and_include_versioned_routers(execution_api_router) File ".../cadwyn/applications.py", line 365, in generate_and_include_versioned_routers self._latest_version_router.include_router(router) File ".../fastapi/routing.py", line 2442, in include_router raise FastAPIError( fastapi.exceptions.FastAPIError: Prefix and path cannot be both empty (path operation: health) ``` It's purely the FastAPI version: with **0.136.3** (everything else identical — airflow 3.2.2, starlette 1.3.1, cadwyn 7.0.0) the api-server starts fine; with **0.137.0** it crash-loops. Related: - cadwyn reports the same FastAPI 0.137.0 breakage (different symptom — `/docs` 404): https://github.com/zmievsa/cadwyn/issues/378 ### How to reproduce 1. Install Airflow 3.2.2 without the constraints file so FastAPI floats to latest: ``` pip install "apache-airflow==3.2.2" pip install "fastapi==0.137.0" ``` 2. Run `airflow api-server`. 3. Startup fails with `FastAPIError: Prefix and path cannot be both empty (path operation: health)`. Workaround: `pip install "fastapi==0.136.3"`. ### Deployment details api-server on a custom image whose base bundles FastAPI from the uncapped `>=0.129.0` range; a rebuild drifted FastAPI 0.136.3 → 0.137.0 and triggered the crash. ### What you think should happen instead? The api-server should start with any FastAPI allowed by the dependency spec. Either: 1. Re-add an upper bound until compatible, e.g. `fastapi[...]>=0.129.0,<0.137`; and/or 2. Give the execution-API `health` route a non-empty path (`@router.get("/")` instead of `@router.get("")`) so it tolerates FastAPI 0.137.0's stricter nested router-inclusion check. ### Operating System Linux ### Deployment Official Apache Airflow Helm Chart ### Apache Airflow Provider(s) _No response_ ### Versions of Apache Airflow Providers _No response_ ### Official Helm Chart version Not Applicable ### 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) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
