{"record":{"id":"baa92bd197bf4f59","repo":"apache/superset","slug":"no-valid-import-files-were-found-baa92b","errorCode":null,"errorMessage":"No valid import files were found","messagePattern":"No valid import files were found","errorType":"exception","errorClass":"NoValidFilesFoundError","httpStatus":400,"severity":"error","filePath":"superset/databases/api.py","lineNumber":1676,"sourceCode":"            400:\n              $ref: '#/components/responses/400'\n            401:\n              $ref: '#/components/responses/401'\n            422:\n              $ref: '#/components/responses/422'\n            500:\n              $ref: '#/components/responses/500'\n        \"\"\"\n        upload = request.files.get(\"formData\")\n        if not upload:\n            return self.response_400()\n        if not is_zipfile(upload):\n            raise IncorrectFormatError(\"Not a ZIP file\")\n        with ZipFile(upload) as bundle:\n            contents = get_contents_from_bundle(bundle)\n\n        if not contents:\n            raise NoValidFilesFoundError()\n\n        passwords = (\n            json.loads(request.form[\"passwords\"])\n            if \"passwords\" in request.form\n            else None\n        )\n        overwrite = request.form.get(\"overwrite\") == \"true\"\n        ssh_tunnel_passwords = (\n            json.loads(request.form[\"ssh_tunnel_passwords\"])\n            if \"ssh_tunnel_passwords\" in request.form\n            else None\n        )\n        ssh_tunnel_private_keys = (\n            json.loads(request.form[\"ssh_tunnel_private_keys\"])\n            if \"ssh_tunnel_private_keys\" in request.form\n            else None\n        )\n        ssh_tunnel_priv_key_passwords = (","sourceCodeStart":1658,"sourceCodeEnd":1694,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/databases/api.py#L1658-L1694","documentation":"Database import counterpart of the dashboard error: the upload IS a ZIP, but get_contents_from_bundle extracted nothing usable, so NoValidFilesFoundError is raised. The bundle either is empty or contains no files matching the expected database export layout.","triggerScenarios":"POST /api/v1/database/import/ with an empty ZIP, a ZIP of a directory rather than of the export files, or a bundle whose entries (names/structure) are all filtered out by get_contents_from_bundle.","commonSituations":"Zipping the parent folder so entries sit under a subdirectory; exporting from a mismatched Superset version with a different file layout; including only unrelated files in the archive.","solutions":["Use the Superset export flow (Settings > Export or the CLI) and upload the produced ZIP unchanged.","Run unzip -l on the archive and verify the expected export YAML files are at the archive root, not nested in a folder.","If nesting is the problem, re-zip from inside the directory so paths are flat."],"exampleFix":"# before: zipped the folder -> archive contains 'export/database.yaml'\nzip -r import.zip export/\n\n# after: flat structure\nzip import.zip database.yaml","handlingStrategy":"validation","validationCode":"import zipfile\nwith zipfile.ZipFile(path) as zf:\n    entries = [n for n in zf.namelist() if not n.endswith(\"/\")]\nassert entries, \"bundle has no files — rebuild from a Superset export\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Zip from inside the export directory so file paths are flat.","Use Superset's own export output; do not repack with extra wrapper folders."],"tags":["import","database","zip","empty-bundle"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}