{"record":{"id":"686b33cc35a7291e","repo":"apache/superset","slug":"no-valid-import-files-were-found","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/charts/api.py","lineNumber":1584,"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":1566,"sourceCodeEnd":1602,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/charts/api.py#L1566-L1602","documentation":"NoValidFilesFoundError raised by the chart import endpoint after the uploaded ZIP is opened: get_contents_from_bundle() extracts the importable payload files, and if it returns nothing (no files match the expected import structure), the request fails with this error. The ZIP was a real archive but not a Superset chart export bundle — the validator found no recognized files inside.","triggerScenarios":"Uploading a ZIP of arbitrary files (e.g. screenshots, a dashboard export where a chart export was expected, or a bundle missing its metadata/ZIP_ROOT_SUB_DIR layout); zipping the parent folder incorrectly so expected paths like <root>/chart.yaml are nested one level deeper; an export bundle from an incompatible Superset version whose layout differs.","commonSituations":"Confusing dashboard and chart import bundles; zipping with `zip -r bundle.zip .` from the wrong directory so the sub-folder structure the reader expects is absent; hand-editing exports and dropping files; version skew between exporting and importing instances.","solutions":["Re-download the bundle from the export endpoint of a compatible version and import it unmodified.","If assembling manually, replicate the export layout exactly — inspect a working export's structure first (unzip -l) and match directory names and file names.","Make sure you are hitting the matching resource: chart bundles go to /api/v1/chart/import/, dashboard bundles to /api/v1/dashboard/import/.","Use the same (or newer, migration-capable) Superset version on import as on export."],"exampleFix":"# before: zipping loose files without the expected bundle structure\nzip bundle.zip chart.yaml  # reader finds no recognized payload -> NoValidFilesFoundError\n\n# after: export then import round-trip\ncurl -o bundle.zip -H \"Authorization: Bearer $T\" 'http://superset:8088/api/v1/chart/export/?q=!(1)'\ncurl -F 'formData=@bundle.zip' -H \"Authorization: Bearer $T\" http://superset:8088/api/v1/chart/import/","handlingStrategy":"validation","validationCode":"from zipfile import ZipFile\n\nwith ZipFile(path) as z:\n    names = z.namelist()\n    has_payload = any(n.endswith(\".yaml\") or n.endswith(\".json\") for n in names)\n    if not has_payload:\n        raise SystemExit(f\"no importable files in bundle: {names}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Round-trip export->import within the same or compatible Superset version without unpacking.","When hand-building bundles, mirror the exact structure of a real export (unzip -l to inspect).","Match bundle type to endpoint (chart vs dashboard import)."],"tags":["rest-api","import-export","charts","zip","validation"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}