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

Airflow DAG graph is not drawing the run_id passed as argument #30602

Closed
1 of 2 tasks
fbmatilla opened this issue Apr 12, 2023 · 15 comments
Closed
1 of 2 tasks

Airflow DAG graph is not drawing the run_id passed as argument #30602

fbmatilla opened this issue Apr 12, 2023 · 15 comments
Labels
affected_version:2.5 Issues Reported for 2.5 area:core duplicate Issue that is duplicated good first issue kind:bug This is a clearly a bug pending-response

Comments

@fbmatilla
Copy link

Apache Airflow version

2.5.3

What happened

Through the Web Interface: If we look for a specific DAG run id (before the last 25 runs) and we try to access the graph:

image

A the details of a different RUNID are really appearing:

image

Looks like the issue is related to the fact that the RUNID passed as argument is not in the combobox of the default selected runs:

image

What you think should happen instead

The execution details of the run id passed as argument should be shown.

How to reproduce

Just follow the steps described in the "What happened" section.

Operating System

Ubuntu 20.04.5

Versions of Apache Airflow Providers

apache-airflow-providers-amazon==7.3.0
apache-airflow-providers-celery==3.1.0
apache-airflow-providers-cncf-kubernetes==5.2.2
apache-airflow-providers-common-sql==1.3.4
apache-airflow-providers-databricks==4.0.0
apache-airflow-providers-docker==3.5.1
apache-airflow-providers-elasticsearch==4.4.0
apache-airflow-providers-ftp==3.3.1
apache-airflow-providers-google==8.11.0
apache-airflow-providers-grpc==3.1.0
apache-airflow-providers-hashicorp==3.3.0
apache-airflow-providers-http==4.2.0
apache-airflow-providers-imap==3.1.1
apache-airflow-providers-microsoft-azure==5.2.1
apache-airflow-providers-microsoft-mssql==3.3.2
apache-airflow-providers-mysql==4.0.2
apache-airflow-providers-odbc==3.2.1
apache-airflow-providers-postgres==5.4.0
apache-airflow-providers-redis==3.1.0
apache-airflow-providers-sendgrid==3.1.0
apache-airflow-providers-sftp==4.2.4
apache-airflow-providers-slack==7.2.0
apache-airflow-providers-snowflake==4.0.4
apache-airflow-providers-sqlite==3.3.1
apache-airflow-providers-ssh==3.5.0

Deployment

Official Apache Airflow Helm Chart

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

@fbmatilla fbmatilla added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Apr 12, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Apr 12, 2023

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

@hussein-awala
Copy link
Member

I can't reproduce on 2.5.3 🤔 can you share the webserver log when you refresh the page?

@eladkal eladkal added Can't Reproduce The problem cannot be reproduced pending-response affected_version:2.5 Issues Reported for 2.5 and removed needs-triage label for new issues that we didn't triage yet labels Apr 15, 2023
@fbmatilla
Copy link
Author

Hi Hussein,

Sure. To be able to reproduce it, it is important to access a RunId that is not included in combobox of the latest 25:

image

In this new example, we are trying to access the run id ES_2023-04-10T09:00:03.594297, however this one CL_2023-04-14T13:00:11.808718 is really appearing.

This are the webserver logs at that time:
ewok-webserver-775db7bf4d-p8m5z.log

@robi-ng
Copy link

robi-ng commented Apr 18, 2023

I'm facing the same issue with Airflow 2.5.3.

@github-actions
Copy link

This issue has been automatically marked as stale because it has been open for 30 days with no response from the author. It will be closed in next 7 days if no further activity occurs from the issue author.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label May 19, 2023
@fbmatilla
Copy link
Author

Hi, this is still happening in 2.5.3, we should keep it open. Thx.

@potiuk potiuk added good first issue and removed Can't Reproduce The problem cannot be reproduced labels May 19, 2023
@github-actions github-actions bot removed the stale Stale PRs per the .github/workflows/stale.yml policy file label May 20, 2023
@sbrinkhorst
Copy link

We're facing the same issue. I upgraded from 2.5.1 to 2.5.3 earlier this week. I think the problem was introduced in 2.5.2, at least I still saw it when I downgraded our acceptance environment to that version.

After clicking around a bit we found the following:

In the List Dag Run table there are two columns you can click on: Dag Id and Run Id

If you click on the dag name in the Dag Id column it actually adds the execution date to the url and that typically takes you to the DAG you're looking for:

https://example.com/dags/your-dag/graph?execution_date=2023-05-26+10%3A01%3A31.066801%2B00%3A00

In the Run Id column it also adds the DAG ID to the URL as well:

https://example.com/dags/your-dag/graph?run_id=manual_2023-05-26T10%3A01%3A30.964UTC&execution_date=2023-05-26+10%3A01%3A31.066801%2B00%3A00

It seems that the date selector for the execution date is not filled correctly if you also provide the run_id, and then it defaults to now. Then it tries to look up your run_id, which only succeeds if your run is in the table (so that will be if it in the 25 most recent runs). You can see in the screenshot @fbmatilla provided that the execution_date from the URL does not match the UI.

So I would describe the issue as "DAG graph view does not use execution_date from URL correctly if dag_run is also provided".

The List Task Instance table has the same issue when clicking on the Run Id, that issue was already present for a longer time. (There the Dag Id column doesn't have the execution_date in the URL but you can go via the Task Id column.) Has something been done to make these lists more consistent, but now it is consistently wrong?

@hussein-awala
Copy link
Member

I just tested it with 2.6.1 and it seems to work normally.

I created this dag:

import pendulum

from airflow import DAG
from airflow.operators.empty import EmptyOperator

with DAG(
    "debug_dag_run",
    start_date=pendulum.datetime(2023, 5, 1),
    schedule_interval="@daily",
    catchup=True,
):
    EmptyOperator(task_id="empty_task")

which created 25 runs, and I triggered 3 runs manually (28 in total).
Screenshot from 2023-05-26 15-13-36

When I choose a run before the last 25 runs, the select list is updated to have just this run_id, and the selected graph is updated to the desired run:
Screenshot from 2023-05-26 15-13-52
Screenshot from 2023-05-26 15-13-56

I will close the issue as completed.
I let you test with 2.6.1, and we can reopen it if you still have the same issue.

@sbrinkhorst
Copy link

Thank you. If I test it locally with that version it works for me again too. We will do the actual upgrade in the next few weeks, but I see no reason why it should not work there.

@shnuwl007
Copy link

shnuwl007 commented May 30, 2023

There is a bug of version 2.5.x, please increase the value of ”default_dag_run_display_number“ in the airflow.cfg file. Its default value is 25, which means it will only return the most recent 25 run_ids belonging to the same dag. If the run_id you are looking for happened earlier, you will not be able to find it.
Or you can added "&num_runs=1000" to the url of the browser, like:
http://localhost:8080/dags/dag_id/graph?run_id=013cdb84-a81f-4369-9e4c-2c7b2d2cb2fb&execution_date=2023-04-20+14%3A48%3A44.795356%2B00%3A00&num_runs=1000
code

@sbrinkhorst
Copy link

Our most used DAG ran close to 90,000 times in the last 30 days, so it is not really feasible for us to rely on increasing the nr of dag runs. We will just upgrade to the new version.

@hterik
Copy link
Contributor

hterik commented Oct 3, 2023

Similar problem present in 2.7.1 #34723

@fbmatilla
Copy link
Author

Hi,

confirmed, this is happening again in version 2.7.2, can we open this bug again, please?

Thanks.

@potiuk
Copy link
Member

potiuk commented Nov 13, 2023

Hi,

confirmed, this is happening again in version 2.7.2, can we open this bug again, please?

Thanks.

Why do you want to reopen it @fbmatilla since this is apparently duplicate of #34723 as @hterik noticed ? Or is it different? Can you take a close look and explain?

@potiuk potiuk added the duplicate Issue that is duplicated label Nov 13, 2023
@fbmatilla
Copy link
Author

Absolutely right. Sorry, I did not see that. Thanks @potiuk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected_version:2.5 Issues Reported for 2.5 area:core duplicate Issue that is duplicated good first issue kind:bug This is a clearly a bug pending-response
Projects
None yet
Development

No branches or pull requests

8 participants