OldrichDlouhy opened a new issue, #30584: URL: https://github.com/apache/superset/issues/30584
### Bug description When importing dashboard and the import fails, the error displayed is leaking HTML code of error page. It seems there is other exception thrown when the import exception is processed. ### Screenshots/recordings  ### Superset version 4.0.2 ### Python version 3.9 ### Node version 16 ### Browser Chrome ### Additional context Extracted stacktrace from the displayed message: ``` Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/usr/local/lib/python3.10/site-packages/flask_appbuilder/security/decorators.py", line 95, in wraps return f(self, *args, **kwargs) File "/app/superset/views/base_api.py", line 127, in wraps raise ex File "/app/superset/views/base_api.py", line 121, in wraps duration, response = time_function(f, self, *args, **kwargs) File "/app/superset/utils/core.py", line 1470, in time_function response = func(*args, **kwargs) File "/app/superset/utils/log.py", line 255, in wrapper value = f(*args, **kwargs) File "/app/superset/views/base_api.py", line 108, in wraps return f(self, *args, **kwargs) File "/app/superset/dashboards/api.py", line 1135, in import_ command.run() File "/app/superset/commands/dashboard/importers/dispatcher.py", line 64, in run raise exc File "/app/superset/commands/dashboard/importers/dispatcher.py", line 57, in run command.run() File "/app/superset/commands/importers/v1/__init__.py", line 71, in run self.validate() File "/app/superset/commands/importers/v1/__init__.py", line 109, in validate raise CommandInvalidError( superset.commands.exceptions.CommandInvalidError: Error importing dashboard During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2529, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.10/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.10/site-packages/flask/app.py", line 1676, in handle_user_exception return self.ensure_sync(handler)(e) File "/app/superset/views/base.py", line 505, in show_command_errors return json_errors_response( File "/app/superset/views/base.py", line 165, in json_errors_response payload["errors"] = [dataclasses.asdict(error) for error in errors] File "/app/superset/views/base.py", line 165, in <listcomp> payload["errors"] = [dataclasses.asdict(error) for error in errors] File "/usr/local/lib/python3.10/dataclasses.py", line 1238, in asdict return _asdict_inner(obj, dict_factory) File "/usr/local/lib/python3.10/dataclasses.py", line 1245, in _asdict_inner value = _asdict_inner(getattr(obj, f.name), dict_factory) File "/usr/local/lib/python3.10/dataclasses.py", line 1275, in _asdict_inner return type(obj)((_asdict_inner(k, dict_factory), File "/usr/local/lib/python3.10/dataclasses.py", line 1276, in <genexpr> _asdict_inner(v, dict_factory)) File "/usr/local/lib/python3.10/dataclasses.py", line 1275, in _asdict_inner return type(obj)((_asdict_inner(k, dict_factory), File "/usr/local/lib/python3.10/dataclasses.py", line 1276, in <genexpr> _asdict_inner(v, dict_factory)) File "/usr/local/lib/python3.10/dataclasses.py", line 1275, in _asdict_inner return type(obj)((_asdict_inner(k, dict_factory), File "/usr/local/lib/python3.10/dataclasses.py", line 1276, in <genexpr> _asdict_inner(v, dict_factory)) File "/usr/local/lib/python3.10/dataclasses.py", line 1275, in _asdict_inner return type(obj)((_asdict_inner(k, dict_factory), TypeError: first argument must be callable or None ``` ### Checklist - [X] I have searched Superset docs and Slack and didn't find a solution to my problem. - [X] I have searched the GitHub issue tracker and didn't find a similar bug report. - [X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section. -- 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]
