apache/superset · error · NoValidFilesFoundError

No valid import files were found

Error message

No valid import files were found

What it means

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.

Source

Thrown at superset/charts/api.py:1584

            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. Re-download the bundle from the export endpoint of a compatible version and import it unmodified.
  2. If assembling manually, replicate the export layout exactly — inspect a working export's structure first (unzip -l) and match directory names and file names.
  3. Make sure you are hitting the matching resource: chart bundles go to /api/v1/chart/import/, dashboard bundles to /api/v1/dashboard/import/.
  4. Use the same (or newer, migration-capable) Superset version on import as on export.

Example fix

# before: zipping loose files without the expected bundle structure
zip bundle.zip chart.yaml  # reader finds no recognized payload -> NoValidFilesFoundError

# after: export then import round-trip
curl -o bundle.zip -H "Authorization: Bearer $T" 'http://superset:8088/api/v1/chart/export/?q=!(1)'
curl -F 'formData=@bundle.zip' -H "Authorization: Bearer $T" http://superset:8088/api/v1/chart/import/
Defensive patterns

Strategy: validation

Validate before calling

from zipfile import ZipFile

with ZipFile(path) as z:
    names = z.namelist()
    has_payload = any(n.endswith(".yaml") or n.endswith(".json") for n in names)
    if not has_payload:
        raise SystemExit(f"no importable files in bundle: {names}")

Prevention

When it happens

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

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

Related errors


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