Pajri opened a new issue #17391:
URL: https://github.com/apache/superset/issues/17391
I tried to access url that is not found (ex : /notfoundpage), but it returns
internal server error instead of not found page.
#### How to reproduce the bug
1. Go to ' /notfoundpage' or any path that is not exists
2. You see Internal Server Error
### Expected results
Show error not found page
### Actual results
Internal Server Error page
Log :
```
`[2021-11-10 09:20:26 +0000] [53] [ERROR] Error handling request /favicon.ico
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1950, in
full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1926, in
dispatch_request
self.raise_routing_exception(req)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1908, in
raise_routing_exception
raise request.routing_exception
File "/usr/local/lib/python3.7/site-packages/flask/ctx.py", line 350, in
match_request
result = self.url_adapter.match(return_rule=True)
File "/usr/local/lib/python3.7/site-packages/werkzeug/routing.py", line
1945, in match
raise NotFound()
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found
on the server. If you entered the URL manually please check your spelling and
try again.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/gthread.py",
line 271, in handle
keepalive = self.handle_request(req, conn)
File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/gthread.py",
line 320, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2464, in
__call__
return self.wsgi_app(environ, start_response)
File
"/usr/local/lib/python3.7/site-packages/werkzeug/middleware/proxy_fix.py", line
169, in __call__
return self.app(environ, start_response)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2450, in
wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask_cors/extension.py",
line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1867, in
handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39,
in reraise
raise value
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2447, in
wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1952, in
full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask_cors/extension.py",
line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1816, in
handle_user_exception
return self.handle_http_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1744, in
handle_http_exception
return handler(e)
File "/app/superset/views/base.py", line 368, in show_http_exception
"text/html" in request.accept_mimetypes
NameError: name 'request' is not defined
10.190.12.34 - - [10/Nov/2021:09:20:26 +0000] "GET /favicon.ico HTTP/1.1"
500 0 "-" "-"
````
#### Screenshots

### Environment
(please complete the following information):
- python version 3.7.12
### Checklist
Make sure to follow these steps before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included
it here as text if there are any.
- [x] I have reproduced the issue with at least the latest released version
of superset.
- [x] I have checked the issue tracker for the same issue and I haven't
found one similar.
### Additional context
Add any other context about the problem here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]