You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by tu...@apache.org on 2020/10/09 14:28:25 UTC
[airflow] branch master updated: Replace nuke with useful
information on error page (#11346)
This is an automated email from the ASF dual-hosted git repository.
turbaszek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new eb5fea7 Replace nuke with useful information on error page (#11346)
eb5fea7 is described below
commit eb5fea7b647e0f4b2338f86eeff6a90e1d6043bc
Author: Tomek Urbaszek <tu...@gmail.com>
AuthorDate: Fri Oct 9 16:27:39 2020 +0200
Replace nuke with useful information on error page (#11346)
This PR replaces nuke asciiart with text about reporting a bug.
As we are no longer using asciiarts this PR removes it.
---
airflow/utils/asciiart.py | 59 ----------------------------
airflow/www/templates/airflow/traceback.html | 9 ++++-
airflow/www/views.py | 10 +++--
3 files changed, 13 insertions(+), 65 deletions(-)
diff --git a/airflow/utils/asciiart.py b/airflow/utils/asciiart.py
deleted file mode 100644
index b59d417..0000000
--- a/airflow/utils/asciiart.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-bug = r"""
- =, .=
- =.| ,---. |.=
- =.| "-(:::::)-" |.=
- \\__/`-.|.-'\__//
- `-| .::| .::|-' Pillendreher
- _|`-._|_.-'|_ (Scarabaeus sacer)
- /.-| | .::|-.\
- // ,| .::|::::|. \\
- || //\::::|::' /\\ ||
- /'\|| `.__|__.' ||/'\
- ^ \\ // ^
- /'\ /'\
- ^ ^
-"""
-
-nukular = r"""
- ____/ ( ( ) ) \___
- /( ( ( ) _ )) ) )\
- (( ( )( ) ) ( ) )
- ((/ ( _( ) ( _) ) ( () ) )
- ( ( ( (_) (( ( ) .((_ ) . )_
- ( ( ) ( ( ) ) ) . ) ( )
- ( ( ( ( ) ( _ ( _) ). ) . ) ) ( )
- ( ( ( ) ( ) ( )) ) _)( ) ) )
- ( ( ( \ ) ( (_ ( ) ( ) ) ) ) )) ( )
- ( ( ( ( (_ ( ) ( _ ) ) ( ) ) )
- ( ( ( ( ( ) (_ ) ) ) _) ) _( ( )
- (( ( )( ( _ ) _) _(_ ( (_ )
- (_((__(_(__(( ( ( | ) ) ) )_))__))_)___)
- ((__) \\||lll|l||/// \_))
- ( /(/ ( ) ) )\ )
- ( ( ( ( | | ) ) )\ )
- ( /(| / ( )) ) ) )) )
- ( ( ((((_(|)_))))) )
- ( ||\(|(|)|/|| )
- ( |(||(||)|||| )
- ( //|/l|||)|\\ \ )
- (/ / // /|//||||\\ \ \ \ _)
--------------------------------------------------------------------------------
-"""
diff --git a/airflow/www/templates/airflow/traceback.html b/airflow/www/templates/airflow/traceback.html
index 367a39e..1438273 100644
--- a/airflow/www/templates/airflow/traceback.html
+++ b/airflow/www/templates/airflow/traceback.html
@@ -23,10 +23,15 @@
</head>
<body>
<div class="container">
- <h1> Ooops. </h1>
+ <h1> Ooops! </h1>
<div>
<pre>
-{{ nukular }}Node: {{ hostname }}
+Something bad has happened.
+Please consider letting us know by creating a <b><a href="https://github.com/apache/airflow/issues/new/choose">bug report using Github</a></b>.
+
+Python version: {{ python_version }}
+Airflow version: {{ airflow_version }}
+Node: {{ hostname }}
-------------------------------------------------------------------------------
{{ info }}</pre>
</div>
diff --git a/airflow/www/views.py b/airflow/www/views.py
index ddae3b7..6a7c4dc 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -22,6 +22,7 @@ import json
import logging
import math
import socket
+import sys
import traceback
from collections import defaultdict
from datetime import datetime, timedelta
@@ -70,6 +71,7 @@ from airflow.utils.helpers import alchemy_to_dict
from airflow.utils.log.log_reader import TaskLogReader
from airflow.utils.session import create_session, provide_session
from airflow.utils.state import State
+from airflow.version import version
from airflow.www import utils as wwwutils
from airflow.www.decorators import action_logging, gzipped, has_dag_access
from airflow.www.forms import (
@@ -318,19 +320,19 @@ def circles(error): # pylint: disable=unused-argument
def show_traceback(error): # pylint: disable=unused-argument
"""Show Traceback for a given error"""
- from airflow.utils import asciiart as ascii_
-
return render_template(
'airflow/traceback.html', # noqa
+ python_version=sys.version.split(" ")[0],
+ airflow_version=version,
hostname=socket.getfqdn() if conf.getboolean(
'webserver',
'EXPOSE_HOSTNAME',
fallback=True) else 'redact',
- nukular=ascii_.nukular,
info=traceback.format_exc() if conf.getboolean(
'webserver',
'EXPOSE_STACKTRACE',
- fallback=True) else 'Error! Please contact server admin'), 500
+ fallback=True) else 'Error! Please contact server admin.'
+ ), 500
######################################################################################
# BaseViews