Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/dag/{dag_id} returns stale dags without its serialized version unlike /dags/{dag_id}/details #16839

Closed
psg2 opened this issue Jul 6, 2021 · 3 comments
Labels
kind:bug This is a clearly a bug

Comments

@psg2
Copy link

psg2 commented Jul 6, 2021

Apache Airflow version: 2.1.1

Kubernetes version (if you are using kubernetes) (use kubectl version):

Environment:

  • Cloud provider or hardware configuration: N/A
  • OS (e.g. from /etc/os-release): N/A
  • Kernel (e.g. uname -a): N/A
  • Install tools: N/A
  • Others: N/A

What happened:

After removing a dag from the filesystem, Airflow cleans up the SerializedDags table and updates the DAG table to mark the DAG with is_active as False. If you call the /dag/{dag_id} endpoint with the removed dag_id, it will return the stale information about the dag, but if you call the /dag/{dag_id}/details you will receive and 404 error Dag Not Found.

Slack thread: https://apache-airflow.slack.com/archives/CCPRP7943/p1625504228302500

What you expected to happen:

Receive a 404 Dag Not Found on /dag/{dag_id} as well.

How to reproduce it:

  1. Write a DAG file
  2. Wait for Airflow to parse it
  3. Remove the file
  4. Call the API

Anything else we need to know:

@psg2 psg2 added the kind:bug This is a clearly a bug label Jul 6, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 6, 2021

Thanks for opening your first issue here! Be sure to follow the issue template!

@mik-laj
Copy link
Member

mik-laj commented Jul 7, 2021

Endpoint /dag/{dag_id} returns the active DAGs by default. If you want access to all DAGs, you must use the is_active parameter. To access all DAGS - both active and inactive, you should pass in_active parameter. Thanks to this, you can access archived data, but by default, you have consistent UI with CLI (airflow dags list) and Web UI (/home/).

@potiuk potiuk closed this as completed Jul 10, 2021
@potiuk
Copy link
Member

potiuk commented Jul 10, 2021

Closed as per conversation in #16842

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug This is a clearly a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants