apache/seatunnel · error · IllegalArgumentException

Unknown compression: ${value}

Error message

Unknown compression: ${value}

What it means

EdgePacketCompressionType.from performs a case-insensitive lookup of the given string over the enum's known values (e.g. NONE, GZIP, ZLIB, DEFLATE). If no constant matches, it throws IllegalArgumentException reporting the unknown value. It is called when reading transport packet compression config.

Source

Thrown at seatunnel-edge-agent/seatunnel-edge-agent-transport/src/main/java/org/apache/seatunnel/edge/agent/transport/packet/EdgePacketCompressionType.java:44

    ZLIB("zlib"),
    DEFLATE("deflate");

    private final String value;

    EdgePacketCompressionType(String value) {
        this.value = value;
    }

    public static EdgePacketCompressionType from(String value) {
        if (value == null || value.isEmpty()) {
            return NONE;
        }
        for (EdgePacketCompressionType t : values()) {
            if (t.value.equalsIgnoreCase(value)) {
                return t;
            }
        }
        throw new IllegalArgumentException("Unknown compression: " + value);
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set the compression value to one of the supported enum values, e.g. "none", "gzip", "zlib", or "deflate".
  2. Check the enum source (EdgePacketCompressionType) for the exact accepted literals for your version.
  3. If you need an unsupported algorithm (snappy/lz4), it is not available — choose the closest supported one or request the feature.
  4. Align the config file with the agent version deployed; a newer enum value on an older binary will not resolve.

Example fix

// before
transport.packet-compression = "snappy"

// after
transport.packet-compression = "gzip"
Defensive patterns

Strategy: type-guard

Validate before calling

String compression = cfg.getString("transport.packet-compression");
Set<String> allowed = Set.of("none", "gzip", "zlib", "deflate");
if (!allowed.contains(compression.trim().toLowerCase(Locale.ROOT))) {
    throw new IllegalStateException("Unsupported packet-compression: " + compression);
}

Type guard

boolean isKnownCompression(String v) {
    return v != null && ("none".equalsIgnoreCase(v) || "gzip".equalsIgnoreCase(v)
        || "zlib".equalsIgnoreCase(v) || "deflate".equalsIgnoreCase(v));
}

Try / catch

try {
    EdgePacketCompressionType type = EdgePacketCompressionType.from(value);
} catch (IllegalArgumentException e) {
    LOG.warn("Falling back to gzip; unknown compression: " + value, e);
    type = EdgePacketCompressionType.GZIP;
}

Prevention

When it happens

Trigger: Configuring packet compression with a string not among the enum values, e.g. "snappy", "lz4", "zip", or "gzip" misspelled as "gzp"; lookup is case-insensitive so case alone never triggers it.

Common situations: Copying compression names from another product (Snappy/LZ4 users); assuming "zip" maps to zlib; typos; an older build lacking a newly introduced enum value used in a newer config file.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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