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

Cannot restore superset metadata database on Percona cluster missing PK on embedded_dashboards table #30642

Open
3 tasks done
christiaan opened this issue Oct 17, 2024 · 2 comments
Labels
data:databases Related to database configurations and connections

Comments

@christiaan
Copy link

Bug description

I have a development deployment of superset which I want to bring into production.

When importing the Mysql dump I made of the mysql database we use for superset and I try to import that dump I get the following error.

INSERT INTO embedded_dashboards .....
ERROR 1105 (HY000) at line 1709: Percona-XtraDB-Cluster prohibits use of DML command on a table (superset.embedded_dashboards) without an explicit primary key with pxc_strict_mode = ENFORCING or MASTER

To "fix" this I've added an id column to the embedded_dashboards table.

ALTER TABLE embedded_dashboards ADD id INT auto_increment primary key

Screenshots/recordings

No response

Superset version

4.0.2

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

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.
Copy link

dosubot bot commented Oct 17, 2024

Hey @christiaan! I'm here to help you with any issues or questions you have about Superset. I can assist with bug fixes, answer your questions, and guide you on becoming a contributor. Let's tackle this together!

The embedded_dashboards table in Superset already has a primary key defined on the uuid column [1]. The error you're encountering with Percona XtraDB Cluster is likely due to the cluster's strict mode settings, which require an explicit primary key for all tables. Since the uuid column serves as the primary key, the issue might be related to how the primary key is defined or recognized in your setup.

To resolve this, ensure that the uuid column is correctly set as the primary key in your database schema. If the issue persists, you might need to adjust the Percona XtraDB Cluster's strict mode settings or consult the Percona documentation for handling tables with existing primary keys.

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added the data:databases Related to database configurations and connections label Oct 17, 2024
@christiaan
Copy link
Author

The uuid column is not a primary key in the embedded_dashboards table. Setting it as the primary key also solves this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:databases Related to database configurations and connections
Projects
None yet
Development

No branches or pull requests

1 participant