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

Graph view crashes when a DAG is empty #41332

Closed
1 of 2 tasks
uranusjr opened this issue Aug 8, 2024 · 3 comments · Fixed by #41335
Closed
1 of 2 tasks

Graph view crashes when a DAG is empty #41332

uranusjr opened this issue Aug 8, 2024 · 3 comments · Fixed by #41335
Labels
area:UI Related to UI/UX. For Frontend Developers. kind:bug This is a clearly a bug

Comments

@uranusjr
Copy link
Member

uranusjr commented Aug 8, 2024

Apache Airflow version

main (development)

If "Other Airflow 2 version" selected, which one?

No response

What happened?

When an empty DAG is created without any tasks, the DAG can be parsed and triggered in the UI, but the UI crashes when you click on Graph. The entire screen (except the top bar) disappears.

Uncaught TypeError: u.nodes.children[0] is undefined
    gQ http://localhost:28080/static/dist/grid.abc695e791ed71742eea.js:2
    wa http://localhost:28080/static/dist/grid.abc695e791ed71742eea.js:2
    Ms http://localhost:28080/static/dist/grid.abc695e791ed71742eea.js:2
    wl http://localhost:28080/static/dist/grid.abc695e791ed71742eea.js:2
    vu http://localhost:28080/static/dist/grid.abc695e791ed71742eea.js:2
    mu http://localhost:28080/static/dist/grid.abc695e791ed71742eea.js:2
    gu http://localhost:28080/static/dist/grid.abc695e791ed71742eea.js:2
    iu http://localhost:28080/static/dist/grid.abc695e791ed71742eea.js:2
    ru http://localhost:28080/static/dist/grid.abc695e791ed71742eea.js:2
    _ http://localhost:28080/static/dist/grid.abc695e791ed71742eea.js:2
    O http://localhost:28080/static/dist/grid.abc695e791ed71742eea.js:2
grid.abc695e791ed71742eea.js:2:2750893

What you think should happen instead?

The UI should load correctly. The graph should be empty (no blocks), but other controls should still load.

How to reproduce

  1. Load this DAG into Airflow

    from airflow.decorators import dag
    
    @dag(schedule=None)
    def empty():
        pass
    
    empty()
  2. Trigger a run from the Home page.

  3. Click into the DAG detail view

  4. Clikc on Graph

Operating System

n/a

Versions of Apache Airflow Providers

No response

Deployment

Other

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

@uranusjr uranusjr added kind:bug This is a clearly a bug area:UI Related to UI/UX. For Frontend Developers. labels Aug 8, 2024
@josix
Copy link
Contributor

josix commented Aug 8, 2024

I made this change to let the page not become blank, but is it okay to display empty dag like this?

image

@romsharon98
Copy link
Contributor

I made this change to let the page not become blank, but is it okay to display empty dag like this?

image

Yes, I think this is how it should look.

@uranusjr
Copy link
Member Author

uranusjr commented Aug 8, 2024

Agreed, I think an empty page is good enough. An empty DAG is a user error anyway, and it’s probably good enough we don’t crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers. kind:bug This is a clearly a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants