[
https://issues.apache.org/jira/browse/AIRFLOW-2263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16615421#comment-16615421
]
ASF GitHub Bot commented on AIRFLOW-2263:
-----------------------------------------
r39132 closed pull request #3897: [AIRFLOW-2263] Fix 500 for null DAG
URL: https://github.com/apache/incubator-airflow/pull/3897
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/airflow/www/views.py b/airflow/www/views.py
index aa2530e458..7e79c0df7f 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -1379,6 +1379,8 @@ def tree(self, session=None):
dag_id = request.args.get('dag_id')
blur = conf.getboolean('webserver', 'demo_mode')
dag = dagbag.get_dag(dag_id)
+ if dag is None:
+ abort(404)
if dag_id not in dagbag.dags:
flash('DAG "{0}" seems to be missing.'.format(dag_id), "error")
return redirect('/admin/')
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> stack trace from null dag in webserver output
> ---------------------------------------------
>
> Key: AIRFLOW-2263
> URL: https://issues.apache.org/jira/browse/AIRFLOW-2263
> Project: Apache Airflow
> Issue Type: Bug
> Reporter: andy dreyfuss
> Assignee: Mark Lavrynenko
> Priority: Major
> Attachments: image-2018-09-14-14-32-19-709.png
>
>
> webserver is reporting the following
> {code:java}
> Traceback (most recent call last):
> File "/path/to/a/virtualenv/lib/python3.6/site-packages/flask/app.py", line
> 1988, in wsgi_app
> response = self.full_dispatch_request()
> File "/path/to/a/virtualenv/lib/python3.6/site-packages/flask/app.py", line
> 1641, in full_dispatch_request
> rv = self.handle_user_exception(e)
> File "/path/to/a/virtualenv/lib/python3.6/site-packages/flask/app.py", line
> 1544, in handle_user_exception
> reraise(exc_type, exc_value, tb)
> File "/path/to/a/virtualenv/lib/python3.6/site-packages/flask/_compat.py",
> line 33, in reraise
> raise value
> File "/path/to/a/virtualenv/lib/python3.6/site-packages/flask/app.py", line
> 1639, in full_dispatch_request
> rv = self.dispatch_request()
> File "/path/to/a/virtualenv/lib/python3.6/site-packages/flask/app.py", line
> 1625, in dispatch_request
> return self.view_functions[rule.endpoint](**req.view_args)
> File "/path/to/a/virtualenv/lib/python3.6/site-packages/flask_admin/base.py",
> line 69, in inner
> return self._run_view(f, *args, **kwargs)
> File "/path/to/a/virtualenv/lib/python3.6/site-packages/flask_admin/base.py",
> line 368, in _run_view
> return fn(self, *args, **kwargs)
> File "/path/to/a/virtualenv/lib/python3.6/site-packages/flask_login.py", line
> 755, in decorated_view
> return func(*args, **kwargs)
> File
> "/path/to/a/virtualenv/lib/python3.6/site-packages/airflow/www/utils.py",
> line 356, in view_func
> return f(*args, **kwargs)
> File
> "/path/to/a/virtualenv/lib/python3.6/site-packages/airflow/www/utils.py",
> line 262, in wrapper
> return f(*args, **kwargs)
> File
> "/path/to/a/virtualenv/lib/python3.6/site-packages/airflow/www/views.py",
> line 1154, in tree
> base_date = dag.latest_execution_date or datetime.utcnow()
> AttributeError: 'NoneType' object has no attribute 'latest_execution_date'
>
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)