{"record":{"id":"2e14eb61e4caf057","repo":"apache/seatunnel","slug":"packet-unsupported-compression","errorCode":"PACKET_UNSUPPORTED_COMPRESSION","errorMessage":"Unsupported packet compression type: ","messagePattern":"Unsupported packet compression type: ","errorType":"error_code","errorClass":"EdgeSocketConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/serialize/payload/EdgeSocketCompressionPayloadDeserializer.java","lineNumber":68,"sourceCode":"    /**\n     * Dispatch payload decompression by compression type.\n     *\n     * @param input payload bytes before decompression\n     * @param compressionType compression algorithm declared by packet\n     * @return decompressed bytes\n     */\n    private byte[] decompress(byte[] input, EdgeSocketCompressionType compressionType) {\n        switch (compressionType) {\n            case NONE:\n                return input;\n            case GZIP:\n                return readAll(new GZIPInputStreamWrapper(input));\n            case ZLIB:\n                return readAll(new InflaterInputStreamWrapper(input, new Inflater()));\n            case DEFLATE:\n                return readAll(new InflaterInputStreamWrapper(input, new Inflater(true)));\n            default:\n                throw new EdgeSocketConnectorException(\n                        EdgeSocketConnectorErrorCode.PACKET_UNSUPPORTED_COMPRESSION,\n                        \"Unsupported packet compression type: \" + compressionType);\n        }\n    }\n\n    /**\n     * Read all bytes from factory-created stream and map IO failures to connector error.\n     *\n     * @param inputStreamFactory stream factory for concrete compression implementation\n     * @return fully decompressed bytes\n     */\n    private byte[] readAll(InputStreamFactory inputStreamFactory) {\n        try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {\n            try (InputStream inputStream = inputStreamFactory.create()) {\n                byte[] buffer = new byte[1024];\n                int len;\n                while ((len = inputStream.read(buffer)) != -1) {\n                    baos.write(buffer, 0, len);","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/serialize/payload/EdgeSocketCompressionPayloadDeserializer.java#L50-L86","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Upgrade the consumer connector to match the producer's compression support.","Set the producer's compression to a supported codec (gzip/zlib/deflate or none).","Inspect the packet's compression field for corruption; validate packets at the sender."],"exampleFix":"// before (producer)\ncompression = \"zstd\"\n// after (producer)\ncompression = \"gzip\"","handlingStrategy":"try-catch","validationCode":"if (compressionType != EdgeSocketCompressionType.GZIP && compressionType != EdgeSocketCompressionType.ZLIB && compressionType != EdgeSocketCompressionType.DEFLATE) {\n    // reject/upgrade before deserializing\n}","typeGuard":null,"tryCatchPattern":"try {\n    byte[] bytes = deserializer.plainBytes(input, compressionType);\n} catch (EdgeSocketConnectorException e) {\n    if (e.getErrorCode() == EdgeSocketConnectorErrorCode.PACKET_UNSUPPORTED_COMPRESSION) {\n        // upgrade consumer or reconfigure producer compression\n    }\n}","preventionTips":["Keep producer and consumer connector versions in sync.","Restrict producers to codecs the whole pipeline supports.","Validate packet headers at the sender before emitting."],"tags":["deserialization","compression","connector-edge-socket"],"backgroundTag":"unsupported-enum-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}