question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Task instance details page blows up when no dagrun

See original GitHub issue

Apache Airflow version: 1.10.9 although I think it would apply to 1.10.10, 1.10.8, 1.10.7, and 1.10.6

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

Environment:

  • Cloud provider or hardware configuration: aws
  • OS (e.g. from /etc/os-release): Ubuntu 18.04.3 LTS
  • Kernel (e.g. uname -a): Linux 567ff872fc2d 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • Install tools:
  • Others:

What happened: If you have a DAG that has not been turned on before and you click on that DAG in the admin page and then in the DAG graph click on one of the tasks and then click on Task Instance Details you get the “Ooops” explosion error page. The error is:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.7/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.7/dist-packages/flask_admin/base.py", line 69, in inner
    return self._run_view(f, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/flask_admin/base.py", line 368, in _run_view
    return fn(self, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/flask_login/utils.py", line 258, in decorated_view
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/airflow/www/utils.py", line 290, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/airflow/www/views.py", line 1041, in task
    dep_context=dep_context)]
  File "/usr/local/lib/python3.7/dist-packages/airflow/www/views.py", line 1039, in <listcomp>
    failed_dep_reasons = [(dep.dep_name, dep.reason) for dep in
  File "/usr/local/lib/python3.7/dist-packages/airflow/models/taskinstance.py", line 668, in get_failed_dep_statuses
    dep_context):
  File "/usr/local/lib/python3.7/dist-packages/airflow/ti_deps/deps/base_ti_dep.py", line 106, in get_dep_statuses
    for dep_status in self._get_dep_statuses(ti, session, dep_context):
  File "/usr/local/lib/python3.7/dist-packages/airflow/ti_deps/deps/dagrun_id_dep.py", line 51, in _get_dep_statuses
    if not dagrun.run_id or not match(BackfillJob.ID_PREFIX + '.*', dagrun.run_id):
AttributeError: 'NoneType' object has no attribute 'run_id'

What you expected to happen: No error page. It should have loaded the standard task instance details page.

I believe the reason that this is happening is because there is no check to see if a dagrun exists in DagrunIdDep: https://github.com/apache/airflow/blob/master/airflow/ti_deps/deps/dagrun_id_dep.py#L50

This is a bit of an edge case because there isn’t really any reason someone should be checking out task instance details for a DAG that has never been run. That said we should probably avoid the error page.

How to reproduce it: If you have a DAG that has not been turned on before and you click on that DAG in the admin page and then in the DAG graph click on one of the tasks and then click on Task Instance Details you get the “Ooops” explosion error page.

Anything else we need to know:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
kaxilcommented, Nov 13, 2020

Closed by https://github.com/apache/airflow/pull/11343

This will be released in 1.10.13

1reaction
mik-lajcommented, Aug 11, 2020

This fix may not have been officially released. Can you check to see if the problem is in the master version?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[GitHub] [airflow] atsalolikhin-spokeo commented on issue #8388 ...
I ran the bash example operator (still following the guide): ``` # run your first task instance airflow run example_bash_operator runme_0 2015-01-01 ```...
Read more >
7 Common Errors to Check When Debugging Airflow DAGs
7 Common Errors to Check When Debugging Airflow DAGs. Tasks not running? DAG stuck? Logs nowhere to be found? We've been there.
Read more >
How to restart a failed task on Airflow - python - Stack Overflow
Go to the dag, and dag run of the run you want to change; Click on GraphView; Click on task A; Click "Clear"....
Read more >
Changelog — Airflow Documentation
Fix moving of dangling TaskInstance rows for SQL Server (#19425) ... Fix webserver exiting when gunicorn master crashes (#13518)(#13780).
Read more >
Troubleshooting DAGs | Cloud Composer
As a result, an Airflow worker might not be able to report the status of a task, or a sensor might be interrupted...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found