openmetadata_managed_apis plugin is detected by Airflow, but the REST blueprint/routes are not registered
Affected module Ingestion Framework (Airflow Managed APIs) Impact: UI “Run Agents” feature depends on Managed APIs; backend server-to-Airflow health check fails Describe the bug The openmetadata_managed_apis plugin is detected by Airflow, but the REST blueprint/routes are not registered. As a result, the OpenMetadata Server’s health check to Airflow Managed APIs at /api/v1/openmetadata/health returns 404, and the UI shows “Airflow APIs not found”. To Reproduce Clean install using official docker-compose (postgres) with OpenMetadata 1.10.2: Start stack (fresh volumes) with: server: 1.10.2 ingestion: 1.10.2 postgresql: 1.10.2 In ingestion container: openmetadata-ingestion == 1.10.2.0 openmetadata-managed-apis == 1.10.2.0 Airflow configured for Postgres: executor = SequentialExecutor sql_alchemy_conn = postgresql+psycopg2://airflow_user:airflow_passpostgresql:5432/airflow_db Plugin is detected: from airflow.plugins_manager import plugins; print([p.name for p in plugins]) → ['openmetadata_managed_apis'] From OpenMetadata Server: PIPELINE_SERVICE_CLIENT_ENDPOINT=http://ingestion:8080 AIRFLOW_USERNAME=admin AIRFLOW_PASSWORD=***** wget -qO- "$PIPELINE_SERVICE_CLIENT_ENDPOINT/api/v1/openmetadata/health" → HTTP 404 Not Found Airflow base API OK: curl -u admin:admin http://localhost:8080/api/v1/health → metadatabase and scheduler “healthy” UI symptom: On a Database Service → Agents tab, you see banner: “Airflow APIs not found at [http://ingestion:8080]. Please validate if the OpenMetadata Airflow plugin is installed correctly.” Expected behavior With the plugin installed and versions matching, the Airflow webserver should register the OpenMetadata blueprint and expose /api/v1/openmetadata/. GET ${PIPELINE_SERVICE_CLIENT_ENDPOINT}/api/v1/openmetadata/health should return a JSON health payload with HTTP 200. OpenMetadata UI should allow creating and deploying agents without “Airflow APIs not found”. Version: OS: macOS (Docker Desktop) Python version (ingestion container): 3.10 OpenMetadata version: 1.10.2 OpenMetadata Ingestion package version: openmetadata-ingestion==1.10.2.0 openmetadata-managed-apis==1.10.2.0 Airflow: bundled with docker.getcollate.io/openmetadata/ingestion:1.10.2 Additional context Validations done: Plugin present: ['openmetadata_managed_apis'] Airflow DB not SQLite; using Postgres; executor = SequentialExecutor Version parity (server vs ingestion/mananged-apis) is exact (1.10.2.x) Airflow base REST API healthy (/api/v1/health) with admin/admin OpenMetadata server env: PIPELINE_SERVICE_CLIENT_ENDPOINT=http://ingestion:8080 AIRFLOW_USERNAME=admin, AIRFLOW_PASSWORD=*** Managed APIs health from server returns 404: wget -qO- "$PIPELINE_SERVICE_CLIENT_ENDPOINT/api/v1/openmetadata/health" → 404 Inspecting Airflow routes under Flask app context shows no openmetadata routes registered. Observed earlier failure mode if Airflow is misconfigured: If Airflow used SQLite + LocalExecutor, plugin would fail import with: AirflowConfigException: cannot use SQLite with the LocalExecutor After fixing airflow.cfg to Postgres, plugin loads, but routes still missing. Ask: Is there a known issue in 1.10.2 where openmetadata_managed_apis loads but does not register the blueprint? Any additional initialization needed for FAB/Flask to expose /api/v1/openmetadata/* in Airflow 2.10.x? Known-good versions for Managed APIs with docker-compose (postgres)? Any diagnostic steps to determine why blueprint registration is skipped?
Perhaps this is the root cause?
The openmetadata-managed-apis==1.10.2 package has a circular import bug:
plugin.py tries to import get_blueprint from api.app api.app.get_blueprint() calls route decorators that access current_app This fails outside Flask app context during plugin loading
With windsurf a patch was found. Of course this is likely not the way - but it got me running again.
GitHub Issue Summary - OpenMetadata 1.10.2 "Airflow APIs Not Found" Fix Problem OpenMetadata 1.10.2 shows "Airflow APIs not found" error. Health endpoint /api/v1/openmetadata/health returns 404.
Root Causes
- Circular Import Bug in openmetadata-managed-apis Plugin plugin.py imports get_blueprint() at module level get_blueprint() loads routes that use security.requires_access decorator Decorator accesses current_app during import, before Flask app context exists Result: Plugin entry point registers, but blueprint never loads, routes return 404 Error in logs:
ImportError: cannot import name 'get_blueprint' from partially initialized module 'openmetadata_managed_apis.api.app' (most likely due to a circular import) 2. psutil Daemon Monitoring Bug Airflow webserver starts with -D (daemon mode) Daemon mode uses psutil to monitor the gunicorn process In Docker containers, process monitoring fails with psutil.NoSuchProcess Result: Webserver starts but immediately crashes Error in logs:
psutil.NoSuchProcess: process PID not found (pid=302) Solution Fix 1: Patch Plugin for Lazy Blueprint Loading Edit /home/airflow/.local/lib/python3.10/site-packages/openmetadata_managed_apis/plugin.py:
python from airflow.plugins_manager import AirflowPlugin from flask import Blueprint from openmetadata_managed_apis.api.config import PLUGIN_NAME from openmetadata_managed_apis.views.rest_api import RestApiView
rest_api_view = {"category": "Admin", "name": "REST API Plugin", "view": RestApiView()}
template_blueprint = Blueprint( "template_blueprint", name, template_folder="views/templates", )
class RestApiPlugin(AirflowPlugin): name = PLUGIN_NAME operators = [] appbuilder_views = [rest_api_view] hooks = [] executors = [] admin_views = [rest_api_view] menu_links = []
_api_blueprint = None
@property
def flask_blueprints(self):
"""Lazy-load blueprints to avoid circular import and app context issues"""
if self._api_blueprint is None:
from airflow.www.app import cached_app
from openmetadata_managed_apis.api.app import get_blueprint
with cached_app().app_context():
self._api_blueprint = get_blueprint()
return [template_blueprint, self._api_blueprint]
Fix 2: Patch Airflow Startup Script Edit /opt/airflow/ingestion_dependency.sh (change last 3 lines):
bash
OLD (daemon mode - crashes with psutil error)
rm -f /opt/airflow/airflow-webserver-monitor.pid airflow webserver --port 8080 -D & airflow scheduler
NEW (foreground mode - stable)
rm -f /opt/airflow/airflow-scheduler.pid airflow scheduler &
rm -f /opt/airflow/airflow-webserver.pid /opt/airflow/airflow-webserver-monitor.pid exec airflow webserver --port 8080 Application (Docker Compose) Copy fixed files into container: bash docker cp ingestion_dependency.sh openmetadata_ingestion:/opt/airflow/ingestion_dependency.sh docker exec openmetadata_ingestion chmod +x /opt/airflow/ingestion_dependency.sh
docker exec openmetadata_ingestion bash -c 'cat > /home/airflow/.local/lib/python3.10/site-packages/openmetadata_managed_apis/plugin.py' < plugin.py Restart: bash docker restart openmetadata_ingestion Verify (wait 90 seconds for startup): bash curl -u admin:admin http://localhost:8080/api/v1/openmetadata/health
Expected: {"status": "healthy", "version": "1.10.2.0"}
Impact ✅ Managed APIs health endpoint works ✅ OpenMetadata UI agent deployment works ✅ Profiler, Auto-Classification, and other agents can be created and scheduled Versions Affected openmetadata-ingestion==1.10.2.0 openmetadata-managed-apis==1.10.2.0 Likely affects 1.10.3 and 1.10.4 (not tested in 1.10.0/1.10.1) Not affected: Earlier versions (1.1.x had working managed APIs per GitHub issue #12760) Request This is a critical regression that breaks core functionality. Please:
Fix circular import in openmetadata-managed-apis plugin Fix psutil daemon monitoring in Docker environments Include fixes in 1.10.5 or 1.11.0
FYR! A user solved this as below.
It turned out that in this mode AIRFLOW__CORE__LAZY_LOAD_PLUGINS=False Airflow assumes all plugins are loaded in the first stage and skips the second stage, which is where OM endpoints are registered. We set this to True for the web server and False for the others.
Thanks @jonosooty for opening this issue - really excited to get this fix into OpenMetadata 🙌
In the meantime, the easiest way to stay up to date is to ⭐ the OpenMetadata repo!
Also, you’re invited to our virtual community meetup this Wednesday! We’ll be sharing the OMD Q1 roadmap and hosting a community spotlight with real-world use cases from Wix. Hope you can join us!