Task instance details page blows up when no dagrun
See original GitHub issueApache 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:
- Created 3 years ago
- Comments:21 (18 by maintainers)
Top GitHub Comments
Closed by https://github.com/apache/airflow/pull/11343
This will be released in 1.10.13
This fix may not have been officially released. Can you check to see if the problem is in the master version?