apache/seatunnel · error · EdgeSocketConnectorException
PACKET_DECODE_ERROR
PACKET_DECODE_ERROR
Error message
Payload decompression failed
What it means
EdgeSocketCompressionPayloadDeserializer.readAll() reads the decompressed packet bytes from the input stream into a byte array. Any IOException while streaming (truncated gzip/zlib stream, corrupt checksum, unexpected EOF) is wrapped as EdgeSocketConnectorException with code PACKET_DECODE_ERROR and message 'Payload decompression failed'. The original IOException is attached as the cause.
Solutions
- Check the attached IOException cause to confirm truncation vs corruption.
- Verify the sender writes and flushes the complete compressed payload before closing.
- Inspect network path (proxies, MTU, socket timeouts) for byte loss.
- Re-run with the producer writing uncompressed ('none') to isolate the compressor.
Defensive patterns
Strategy: try-catch
Try / catch
try {
byte[] payload = readAll(inputStream);
} catch (EdgeSocketConnectorException e) {
if (e.getErrorCode() == EdgeSocketConnectorErrorCode.PACKET_DECODE_ERROR && e.getCause() instanceof IOException) {
// log the truncated/corrupt packet and skip or reconnect
}
} Prevention
- Ensure senders flush complete compressed payloads before closing the stream.
- Monitor network links for truncation (proxies, idle timeouts).
- Test with compression=none to isolate compressor vs network issues.
When it happens
Trigger: readAll() called from decompress() hits an IOException from the underlying GZIP/Inflater input stream — truncated payload, corrupted compressed bytes, or stream closed mid-read.
Common situations: Network truncation between sender and receiver, sender flushing incomplete compressed payloads, or a writer bug producing invalid gzip/zlib data.
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- GOOGLE-SHEETS-01
- PACKET_UNSUPPORTED_COMPRESSION
- String json deserialization exception.
- A deserialization failure event arrived
- Can not find any plugin(source/sink/transform) in the dir
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/309e5fb39aeab03b.
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:91
/**
* 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);
}
}
return baos.toByteArray();
} catch (IOException ioException) {
throw new EdgeSocketConnectorException(
EdgeSocketConnectorErrorCode.PACKET_DECODE_ERROR,
"Payload decompression failed",
ioException);
}
}
/** Lazily creates compression-specific input streams for payload decoding. */
private interface InputStreamFactory {
/**
* Create input stream for decompression.
*
* @return input stream over compressed payload
* @throws IOException if stream init fails
*/
InputStream create() throws IOException;
}
private static class GZIPInputStreamWrapper implements InputStreamFactory {View on GitHub (pinned to cf67b549a7)