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

Exported MySQL Database Connection cannot be imported #30585

Open
3 tasks done
OldrichDlouhy opened this issue Oct 11, 2024 · 1 comment
Open
3 tasks done

Exported MySQL Database Connection cannot be imported #30585

OldrichDlouhy opened this issue Oct 11, 2024 · 1 comment
Labels
data:connect:mysql Related to MySQL data:databases Related to database configurations and connections

Comments

@OldrichDlouhy
Copy link

Bug description

Importing MySQL connection exported on different Superset instance fails on validation.

  1. On first instance, create MySQL connection
  2. On Advanced tab, edit the Chart Cache Timeout and set it to 3600
  3. Export the connection
  4. On second superset instance, add database and select "Import database from file"
  5. Select file exported in step 3

Expected result: Superset asks for user DB password and imports the connection

Actual results: Import error is shown in the "Connect a database" dialog

Workaround:
Extract the connection yaml file from the exported zip file and comment out the timeouts. Repack the zip file and import it.

Original MySQL.yaml:

database_name: MySQL
sqlalchemy_uri: mysql+mysqldb://username:XXXXXXXXXX@cloud-sql-proxy:3306/eDigi
cache_timeout: 3600
expose_in_sqllab: true
allow_run_async: false
allow_ctas: false
allow_cvas: false
allow_dml: false
allow_file_upload: false
extra:
  allows_virtual_table_explore: true
  metadata_cache_timeout:
    schema_cache_timeout: ''
uuid: 130d3f07-d4bc-4e74-bf35-ca16a61666e0
version: 1.0.0

Fixed MySQL.yaml:

database_name: MySQL
sqlalchemy_uri: mysql+mysqldb://username:XXXXXXXXXX@cloud-sql-proxy:3306/eDigi
# cache_timeout: 3600
expose_in_sqllab: true
allow_run_async: false
allow_ctas: false
allow_cvas: false
allow_dml: false
allow_file_upload: false
extra:
  allows_virtual_table_explore: true
#  metadata_cache_timeout:
#    schema_cache_timeout: ''
uuid: 130d3f07-d4bc-4e74-bf35-ca16a61666e0
version: 1.0.0

Possibly related issues:

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.
@dosubot dosubot bot added data:connect:mysql Related to MySQL data:databases Related to database configurations and connections labels Oct 11, 2024
Copy link

dosubot bot commented Oct 11, 2024

The issue with importing a MySQL connection that includes timeouts might be related to validation checks on the cache_timeout and metadata_cache_timeout fields. If these fields are not handled correctly during import, it can lead to errors.

To resolve this, you can:

  1. Remove or Comment Out Timeouts: As you've discovered, commenting out the cache_timeout and metadata_cache_timeout fields in the YAML file can bypass the validation issue.

  2. Check Validation Logic: Ensure that the fields are correctly formatted and meet any validation requirements in the Superset version you are using.

  3. Update Superset: If possible, check if there are updates or patches available for Superset that address this issue.

The workaround you've used is effective, but it might be worth investigating if there are any updates or configuration changes that could permanently resolve the issue.

To continue talking to Dosu, mention @dosu.

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

No branches or pull requests

1 participant