Open JatinVenkatesh opened 3 days ago
I found some similar issues and discussions that might help you resolve the import errors you're encountering:
Similar Issues and Discussions:
Suggested Solutions:
Downgrade to Version 4.0.0: Some users have reported that downgrading to version 4.0.0 resolved their import issues:
export TAG=4.0.0
docker compose -f docker-compose-image-tag.yml up
You can find more details and example dashboards in this issue [2].
Check and Fix YAML Files: If the error is related to incorrect values in the template_params
parameter, you can manually fix the exported YAML files:
template_params
field in the YAML files and replace ''
with null
.Ensure Correct Folder Structure: Make sure the folder structure in the ZIP file is correct. The root should contain directories like Databases
and Datasets
. More details are available in this issue [5].
Import Request Structure: Ensure that your import request is correctly formatted and includes all necessary information. The import endpoint expects a multipart/form-data request with the following fields:
formData
: The uploaded file (ZIP or JSON).passwords
: A JSON map of passwords for each featured database in the ZIP file.overwrite
: A boolean indicating whether to overwrite existing dashboards.ssh_tunnel_passwords
: A JSON map of passwords for each SSH tunnel associated with a featured database in the ZIP file.ssh_tunnel_private_keys
: A JSON map of private keys for each SSH tunnel associated with a featured database in the ZIP file.Example:
import requests
url = "http://your-superset-instance/api/v1/dashboard/import/"
files = {
'formData': ('dashboard.zip', open('path/to/your/dashboard.zip', 'rb')),
}
data = {
'passwords': '{"databases/MyDatabase.yaml": "my_password"}',
'overwrite': 'true',
'ssh_tunnel_passwords': '{"databases/MyDatabase.yaml": "my_ssh_password"}',
'ssh_tunnel_private_keys': '{"databases/MyDatabase.yaml": "my_private_key"}',
}
response = requests.post(url, files=files, data=data)
print(response.status_code)
print(response.json())
Ensure that the paths and passwords in the JSON maps match the structure and contents of your ZIP file [6][7].
Permissions: Ensure that the user performing the import has the "can_write" permission on the "Database" resource. Without this permission, the import will fail if the database does not already exist [8].
These steps should help you troubleshoot and resolve the import errors you're facing.
To continue talking to Dosu, mention @dosu.
What type of database were you attempting to import?
Also curious if you see any more error logs/stacktraces ont the frontend or in the server logs.
Bug description
I was performing some exercise on the export and import of dashboards and databases. First, I exported the database and removed the database from the database connection. Then, when I try to import the database using the same zip file, I get the following error:.
Same goes for the dashboard as well:
How to reproduce the bug
Screenshots/recordings
Database error:
Dashboard error:
Superset version
4.0.2
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist