apache/superset · error · DatabaseUploadFailed

ZIP file contains multiple file types

Error message

ZIP file contains multiple file types

What it means

DatabaseUploadFailed ('ZIP file contains multiple file types') raised when the set of entry-name suffixes in the uploaded ZIP has more than one distinct value. Because ColumnarReader concatenates every entry into one DataFrame, all entries must be the same type (all .parquet); a mixed archive is rejected before extraction.

Source

Thrown at superset/commands/database/uploaders/columnar_reader.py:103

        file_suffix = Path(file.filename).suffix
        if not file_suffix:
            raise DatabaseUploadFailed(_("Unexpected no file extension found"))
        file_suffix = file_suffix[1:]  # remove the dot
        if file_suffix == "zip":
            if not is_zipfile(file):
                raise DatabaseUploadFailed(_("Not a valid ZIP file"))
            try:
                with ZipFile(file) as zip_file:
                    # guard against decompression bombs before reading entries,
                    # mirroring the importer path
                    try:
                        check_is_safe_zip(zip_file)
                    except SupersetException as ex:
                        raise DatabaseUploadFailed(str(ex)) from ex
                    # check if all file types are of the same extension
                    file_suffixes = {Path(name).suffix for name in zip_file.namelist()}
                    if len(file_suffixes) > 1:
                        raise DatabaseUploadFailed(
                            _("ZIP file contains multiple file types")
                        )
                    for filename in zip_file.namelist():
                        with zip_file.open(filename) as file_in_zip:
                            yield BytesIO(file_in_zip.read())
            except BadZipfile as ex:
                raise DatabaseUploadFailed(_("Not a valid ZIP file")) from ex
        else:
            yield file

    def file_to_dataframe(self, file: FileStorage) -> pd.DataFrame:
        """
        Read Columnar file into a DataFrame

        :return: pandas DataFrame
        :throws DatabaseUploadFailed: if there is an error reading the file
        """
        return pd.concat(

View on GitHub (pinned to f4587218dd)

Solutions

  1. Re-zip only the .parquet files: zip clean.zip *.parquet from the data directory
  2. On macOS, avoid Finder compression or run zip -d data.zip '__MACOSX/*' to strip resource-fork entries
  3. Upload the files individually if mixing types is intentional

Example fix

# before: Finder-created archive
unzip -l bundle.zip   # shows __MACOSX/ entries
# after
zip -d bundle.zip '__MACOSX/*' '*/*'  # keep only top-level .parquet entries
Defensive patterns

Strategy: validation

Validate before calling

import zipfile
from pathlib import Path

def zip_is_single_type(fh) -> bool:
    fh.seek(0)
    with zipfile.ZipFile(fh) as z:
        suffixes = {Path(n).suffix for n in z.namelist()}
        return len(suffixes) == 1

Prevention

When it happens

Trigger: Uploading a ZIP containing e.g. 'a.parquet' plus 'manifest.csv', 'readme.txt', or '__MACOSX/._a.parquet' (which has no/other suffix); archives bundling data files with metadata or logs.

Common situations: macOS Finder 'Compress' adding __MACOSX resource-fork entries; users zipping an entire export folder including logs/manifests; archives shared from Windows tools adding thumbs.db-style entries.

Related errors


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