Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error importing dashboard #27027

Open
3 tasks done
ruifpedro opened this issue Feb 6, 2024 · 8 comments
Open
3 tasks done

Error importing dashboard #27027

ruifpedro opened this issue Feb 6, 2024 · 8 comments
Assignees
Labels
dashboard:import Related to importing dashboards data:connect:trino Related to Trino

Comments

@ruifpedro
Copy link

ruifpedro commented Feb 6, 2024

Bug description

Hey Superset team!

Since I've upgraded from Superset v3.0.0 to v3.1.0, I have stopped being able to successfully import dashboards that contain datasets that specifically use a Trino datasource, with the new feature of Enable row expansion in schemas enabled.
Additionally figured out that if I modify the respective database yaml that is shipped out in the zip export, and manually remove the extra.schema_options key and values, importing works. This mitigates the problem for the time being, but does not solve it.

The source of the problem seems to lie in the Superset importing tool not take into account this new Trino feature.

I will provide evidence and more context below.

Looking forward for your response and happy to clarify any more details.

How to reproduce the bug

  1. Go to Dashboards
  2. Bulk select dashboards that contain charts that use a Trino database with Enable row expansion in schemas enabled
  3. Export dashboards
  4. Import dashboards

Screenshots/recordings

Superset stacktrace:

Command failed validation
2024-02-06 10:56:35,825:INFO:superset.commands.dashboard.importers.dispatcher:Command failed validation
CommandException
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.9/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.9/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 1454, 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 1193, 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 73, in run
    self.validate()
  File "/app/superset/commands/importers/v1/__init__.py", line 111, in validate
    raise CommandInvalidError(
superset.commands.exceptions.CommandInvalidError: Error importing dashboard
2024-02-06 10:56:35,826:WARNING:superset.views.base:CommandException
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.9/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.9/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 1454, 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 1193, 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 73, in run
    self.validate()
  File "/app/superset/commands/importers/v1/__init__.py", line 111, in validate
    raise CommandInvalidError(
superset.commands.exceptions.CommandInvalidError: Error importing dashboard

Screenshots

Superset error
Screenshot_20240206_110928

Browser debug
Screenshot_20240206_111352

Trino Database connection
Screenshot_20240206_110907

Trino Database exported YAML
Screenshot_20240206_111702

Superset version

3.1.0

Python version

3.9

Node version

Not applicable

Browser

Firefox

Additional context

I have the following feature flags enabled:

FEATURE_FLAGS = {
      "ALERT_REPORTS": True,
      "DASHBOARD_RBAC": True,
      "ENABLE_TEMPLATE_PROCESSING": True,
    }

There are no customization made on Superset, but the container image is packaged by me in order to include necessary dependencies like the Trino connector.
The Superset is deployed in Kubernetes using the official Superset helm chart.

About the data source I am querying, I've already provided details on it on the post.

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • 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.
@michael-s-molina
Copy link
Member

michael-s-molina commented Feb 28, 2024

Nice issue description @ruifpedro! Thank you.

I'll tag some folks with more knowledge about that feature: @betodealmeida @eschutho @rusackas

@ilndinesh
Copy link

Hello @ruifpedro thank you for detailed explanation. It helped us as well.

@lokeshwar9
Copy link

Hello @ruifpedro , Your detailed explanation helped us figure out that checking the "enable row expansion" is causing the dashboard import error in the same instance and different instance, we fixed it by writing code to stop schema options keys from going into the export zip.
we noticed that we are unable to uncheck the "enable row expansion" using GUI and we used curl to uncheck it.
Many Thanks once again and hope this helps others as well.
Good day

@marituhone
Copy link

marituhone commented Apr 25, 2024

@ruifpedro do you manage to solve the issue?i get the same issue how can i fix it?

@ruifpedro
Copy link
Author

Hello @ruifpedro , Your detailed explanation helped us figure out that checking the "enable row expansion" is causing the dashboard import error in the same instance and different instance, we fixed it by writing code to stop schema options keys from going into the export zip. we noticed that we are unable to uncheck the "enable row expansion" using GUI and we used curl to uncheck it. Many Thanks once again and hope this helps others as well. Good day

I've missed your comment! Yes that it's the case, I'm also unable to uncheck the "enable row expansion" option.

@ruifpedro
Copy link
Author

@ruifpedro do you manage to solve the issue?i get the same issue how can i fix it?

As my first post states, I've managed to circumvent the problem by simply, exporting the dashboard, opening up the zip and modifying the respective database yaml to manually remove the extra.schema_options key and values. Zip the contents and then you have a valid set of assets that can be imported.

@JustGui
Copy link

JustGui commented Oct 3, 2024

Hey guys ! It's still an issue on 4.0.2; is a fix planned for it ?

@rusackas rusackas added data:connect:trino Related to Trino dashboard:import Related to importing dashboards labels Oct 4, 2024
@rusackas
Copy link
Member

rusackas commented Oct 4, 2024

Hey guys ! It's still an issue on 4.0.2; is a fix planned for it ?

Welcomed, yes, but planned... not so much. Unless @yousoph is aware of this and planning to get it in a Preset sprint, I doubt we'll see a fix soon. Contributions/PRs more than welcomed if you'd like to tackle this one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard:import Related to importing dashboards data:connect:trino Related to Trino
Projects
None yet
Development

No branches or pull requests

9 participants