apache/seatunnel · error · EdgeSocketConnectorException

PACKET_UNSUPPORTED_COMPRESSION

PACKET_UNSUPPORTED_COMPRESSION

Error message

Unsupported packet compression type: 

What it means

During packet decompression, EdgeSocketCompressionPayloadDeserializer.decompress() switches on the compression type of an incoming payload. If the type is not one of the handled algorithms (GZIP, ZLIB, DEFLATE), it throws EdgeSocketConnectorException with code PACKET_UNSUPPORTED_COMPRESSION. This indicates the packet was produced with a compression algorithm this deserializer cannot read.

Solutions

  1. Upgrade the consumer connector to match the producer's compression support.
  2. Set the producer's compression to a supported codec (gzip/zlib/deflate or none).
  3. Inspect the packet's compression field for corruption; validate packets at the sender.

Example fix

// before (producer)
compression = "zstd"
// after (producer)
compression = "gzip"
Defensive patterns

Strategy: try-catch

Validate before calling

if (compressionType != EdgeSocketCompressionType.GZIP && compressionType != EdgeSocketCompressionType.ZLIB && compressionType != EdgeSocketCompressionType.DEFLATE) {
    // reject/upgrade before deserializing
}

Try / catch

try {
    byte[] bytes = deserializer.plainBytes(input, compressionType);
} catch (EdgeSocketConnectorException e) {
    if (e.getErrorCode() == EdgeSocketConnectorErrorCode.PACKET_UNSUPPORTED_COMPRESSION) {
        // upgrade consumer or reconfigure producer compression
    }
}

Prevention

When it happens

Trigger: decompress() (via plainBytes) receives a payload whose declared compressionType falls through the switch default — typically a newly added enum constant or an unknown value parsed from the packet header.

Common situations: Producer and consumer connector versions differ so the producer uses a compression codec the consumer build does not support, or a corrupt/adversarial packet declares an out-of-range compression value.

Related errors


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

Appendix: source

Thrown at seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/serialize/payload/EdgeSocketCompressionPayloadDeserializer.java:68

    /**
     * Dispatch payload decompression by compression type.
     *
     * @param input payload bytes before decompression
     * @param compressionType compression algorithm declared by packet
     * @return decompressed bytes
     */
    private byte[] decompress(byte[] input, EdgeSocketCompressionType compressionType) {
        switch (compressionType) {
            case NONE:
                return input;
            case GZIP:
                return readAll(new GZIPInputStreamWrapper(input));
            case ZLIB:
                return readAll(new InflaterInputStreamWrapper(input, new Inflater()));
            case DEFLATE:
                return readAll(new InflaterInputStreamWrapper(input, new Inflater(true)));
            default:
                throw new EdgeSocketConnectorException(
                        EdgeSocketConnectorErrorCode.PACKET_UNSUPPORTED_COMPRESSION,
                        "Unsupported packet compression type: " + compressionType);
        }
    }

    /**
     * Read all bytes from factory-created stream and map IO failures to connector error.
     *
     * @param inputStreamFactory stream factory for concrete compression implementation
     * @return fully decompressed bytes
     */
    private byte[] readAll(InputStreamFactory inputStreamFactory) {
        try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
            try (InputStream inputStream = inputStreamFactory.create()) {
                byte[] buffer = new byte[1024];
                int len;
                while ((len = inputStream.read(buffer)) != -1) {
                    baos.write(buffer, 0, len);

View on GitHub (pinned to cf67b549a7)