Area: Ingestion Issues
Sub-Area: Airflow Plugin Compatibility
Applies to: OSS + Cloud
Issue
The Open in Airflow link on a DAG in DataHub ends in /tree?dag_id=<dag_id>. When you click it, Airflow shows a 404 or a "page not found" page, or the link opens the wrong host.
You Might Be Asking
- Why does the Open in Airflow link end in
/treeinstead of the DAG page? - Why does the Airflow link in DataHub return a 404?
- Will upgrading the DataHub Airflow plugin fix the link?
- Does the Astronomer URL format affect how DataHub builds the link?
Cause
Plugin releases before 1.7.0.20 build the DAG link as <base_url>/tree?dag_id=<dag_id>.
- On Airflow 2, Airflow redirects
/treeto the DAG's grid view. The path works. A broken link on Airflow 2 comes from the base URL. - On Airflow 3, there is no
/treepage, so the DAG link opens a page that does not exist. Task links use/dags/<dag_id>/tasks/<task_id>and work. - The plugin takes the base URL from the Airflow configuration. If no base URL is set, links start with
http://localhost:8080.
The Astronomer URL format does not cause the /tree path.
Solution
- Check the start of the link. If it starts with
http://localhost:8080or a host you do not use, set the Airflow base URL to the full URL that you use to open Airflow.- On Airflow 2, set
[webserver] base_url(environment variableAIRFLOW__WEBSERVER__BASE_URL). - On Airflow 3, set
[api] base_url(environment variableAIRFLOW__API__BASE_URL).
- On Airflow 2, set
- Run the DAG. The plugin writes the link when a DAG run starts, so the link changes after the next run.
- DataHub no longer supports Airflow 2.x, and plugin fixes ship only for Airflow 3. On Airflow 2, do not run an unpinned
pip install --upgrade acryl-datahub-airflow-plugin, with or without the[airflow2]extra. Releases 1.6.0.1 and later require Airflow 3.0 or later and have no[airflow2]extra, so pip upgrades Airflow itself or the install fails. On Airflow 2.7 to 2.10, keep the plugin at 1.6.0 or earlier:pip install 'acryl-datahub-airflow-plugin[airflow2]<=1.6.0'. An upgrade does not change the DAG link. - On Airflow 3, upgrade the plugin to 1.7.0.20 or later, then run the DAG again. Plugin 1.7.0.20 and later build the DAG link as
<base_url>/dags/<dag_id>. Upgrading to 1.6.0 does not fix the link.
Plugin settings go in the [datahub] section of airflow.cfg or in AIRFLOW__DATAHUB__* environment variables. The plugin has no separate configuration file. The base URL is an Airflow setting, not a [datahub] setting.
The plugin versions for each Airflow version are in Compatibility.
Related Documentation
- Airflow Integration: Incorrect URLs
- Airflow Integration: Compatibility
- Airflow Integration: Changelog
Tags: airflow, airflow-plugin, open-in-airflow, url-format, base-url, acryl-datahub-airflow-plugin, astronomer, dag-link