apache/seatunnel · warning

The {} file format is incorrect. Please check the format in

Error message

The {} file format is incorrect. Please check the format in the compressed file.

What it means

A warning logged by AbstractReadStrategy's compressed-file filter check. When reading files inside a compressed archive, the reader checks whether the inner file name ends with one of the configured file format's suffixes (file.getAllSuffix()). If no suffix matches, it logs this warning and excludes the file from reading.

Source

Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/AbstractReadStrategy.java:697

                        String.format(
                                "Archived entry exceeds %,d bytes (POI limit). "
                                        + "Please set excel_engine = EasyExcel, or increase the limit if POI is required.",
                                maxBytes));
            }
            byteArrayOutputStream.write(buffer, 0, bytesRead);
        }

        return new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
    }

    protected boolean checkFileType(String fileName, FileFormat fileFormat) {
        for (String suffix : fileFormat.getAllSuffix()) {
            if (fileName.endsWith(suffix)) {
                return true;
            }
        }

        log.warn(
                "The {} file format is incorrect. Please check the format in the compressed file.",
                fileName);
        return false;
    }

    protected static InputStream safeSlice(InputStream in, long start, long length)
            throws IOException {
        if (start > 0) {
            if (in instanceof Seekable) {
                ((Seekable) in).seek(start);
            } else {
                long toSkip = start;
                while (toSkip > 0) {
                    long skipped = in.skip(toSkip);
                    if (skipped <= 0) {
                        throw new SeaTunnelException("skipped error");
                    }
                    toSkip -= skipped;

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Rename the inner files in the archive so they carry the suffix expected by the configured file_format_type (e.g. .csv, .json, .txt).
  2. Check file_format_type and its associated suffix options in the source config to ensure they match the compressed content.
  3. Pre-extract the archive and only re-compress the files matching the expected format, or filter archives before ingestion.
  4. If skipping is expected behavior, ignore the warning — the file is simply excluded from the read set.

Example fix

// before
file_format_type = "text"  # archive contains data.dat
// after
# rename entry inside archive to data.txt, or set format suffixes to include .dat
Defensive patterns

Strategy: validation

Validate before calling

// before configuring archive reads
List<String> entries = listArchiveEntries(path);
Set<String> suffixes = fileFormat.getAllSuffix();
List<String> bad = entries.stream()
    .filter(e -> suffixes.stream().noneMatch(e::endsWith))
    .collect(Collectors.toList());
if (!bad.isEmpty()) { /* rename, exclude, or fix file_format_type */ }

Type guard

boolean hasKnownSuffix(String name, List<String> suffixes) {
    return suffixes != null && suffixes.stream().anyMatch(name::endsWith);
}

Prevention

When it happens

Trigger: A compressed archive (zip/gzip/tar etc.) is read with compress_codec enabled, and an entry inside the archive has a file name that does not end with any suffix configured for the chosen file_format_type (e.g. an inner file named 'data.dat' while file_type=text expects .txt/.csv/.json suffixes).

Common situations: Archives containing mixed file types (images, metadata, README files) where non-data files are silently skipped; users renaming data files to extensionless names; mismatch between file_format_type config and actual inner file extensions.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/ae0d24de3dae2180. Report an issue: GitHub.