apache/superset · error · NoValidFilesFoundError

No valid import files were found

Error message

No valid import files were found

What it means

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.

Source

Thrown at superset/databases/api.py:1676

            400:
              $ref: '#/components/responses/400'
            401:
              $ref: '#/components/responses/401'
            422:
              $ref: '#/components/responses/422'
            500:
              $ref: '#/components/responses/500'
        """
        upload = request.files.get("formData")
        if not upload:
            return self.response_400()
        if not is_zipfile(upload):
            raise IncorrectFormatError("Not a ZIP file")
        with ZipFile(upload) as bundle:
            contents = get_contents_from_bundle(bundle)

        if not contents:
            raise NoValidFilesFoundError()

        passwords = (
            json.loads(request.form["passwords"])
            if "passwords" in request.form
            else None
        )
        overwrite = request.form.get("overwrite") == "true"
        ssh_tunnel_passwords = (
            json.loads(request.form["ssh_tunnel_passwords"])
            if "ssh_tunnel_passwords" in request.form
            else None
        )
        ssh_tunnel_private_keys = (
            json.loads(request.form["ssh_tunnel_private_keys"])
            if "ssh_tunnel_private_keys" in request.form
            else None
        )
        ssh_tunnel_priv_key_passwords = (

View on GitHub (pinned to f4587218dd)

Solutions

  1. Use the Superset export flow (Settings > Export or the CLI) and upload the produced ZIP unchanged.
  2. Run unzip -l on the archive and verify the expected export YAML files are at the archive root, not nested in a folder.
  3. If nesting is the problem, re-zip from inside the directory so paths are flat.

Example fix

# before: zipped the folder -> archive contains 'export/database.yaml'
zip -r import.zip export/

# after: flat structure
zip import.zip database.yaml
Defensive patterns

Strategy: validation

Validate before calling

import zipfile
with zipfile.ZipFile(path) as zf:
    entries = [n for n in zf.namelist() if not n.endswith("/")]
assert entries, "bundle has no files — rebuild from a Superset export"

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/superset@f4587218dd (2026-08-14). Data as JSON: /api/errors/baa92bd197bf4f59. Report an issue: GitHub.