{"record":{"id":"75f0b63673884fbf","repo":"apache/seatunnel","slug":"packet-decode-error-75f0b6","errorCode":"PACKET_DECODE_ERROR","errorMessage":"Deserialize edge ingress packet failed","messagePattern":"Deserialize edge ingress packet failed","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/record/EdgeSocketPacketRecordDeserializer.java","lineNumber":70,"sourceCode":"     */\n    @Override\n    public EdgeSocketQueuedRecord deserializeRecord(String rawMessage) {\n        try {\n            EdgeSocketIngressPacket packet =\n                    OBJECT_MAPPER.readValue(rawMessage, EdgeSocketIngressPacket.class);\n            byte[] payloadBytes = Base64.getDecoder().decode(packet.getPayload());\n\n            EdgeSocketEncryptionType encryptionType =\n                    EdgeSocketEncryptionType.from(defaultIfBlank(packet.getEncryption()));\n            byte[] decryptedPayload = decodeEncryption(payloadBytes, packet, encryptionType);\n\n            EdgeSocketCompressionType compressionType =\n                    EdgeSocketCompressionType.from(defaultIfBlank(packet.getCompression()));\n            return new EdgeSocketQueuedRecord(decryptedPayload, compressionType);\n        } catch (EdgeSocketConnectorException known) {\n            throw known;\n        } catch (Exception exception) {\n            throw new EdgeSocketConnectorException(\n                    EdgeSocketConnectorErrorCode.PACKET_DECODE_ERROR,\n                    \"Deserialize edge ingress packet failed\",\n                    exception);\n        }\n    }\n\n    /**\n     * Decode payload encryption according to packet metadata.\n     *\n     * @param payloadBytes base64-decoded payload bytes from packet\n     * @param packet ingress packet metadata\n     * @param encryptionType resolved encryption type\n     * @return decrypted payload bytes (or original bytes when encryption is NONE)\n     */\n    private byte[] decodeEncryption(\n            byte[] payloadBytes,\n            EdgeSocketIngressPacket packet,\n            EdgeSocketEncryptionType encryptionType) {","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/serialize/record/EdgeSocketPacketRecordDeserializer.java#L52-L88","documentation":"EdgeSocketPacketRecordDeserializer.deserializeRecord() converts a raw ingress packet into a queued record (decrypt, then resolve compression). Any unexpected exception during this pipeline that is not already an EdgeSocketConnectorException is wrapped as EdgeSocketConnectorException with code PACKET_DECODE_ERROR and message 'Deserialize edge ingress packet failed', preserving the root cause.","triggerScenarios":"deserializeRecord() encounters a non-EdgeSocketConnectorException while parsing the packet (malformed JSON/binary structure, Base64 decode failure on iv, crypto errors, unexpected field types). Known EdgeSocketConnectorExceptions are rethrown unchanged.","commonSituations":"Sender and receiver disagree on packet schema/version, a peer sending garbage or truncated frames, or wrong packet_mode producing binary the record deserializer cannot parse.","solutions":["Inspect the wrapped cause exception to identify the failing parse step.","Verify sender and receiver use the same packet schema/version and packet_mode.","Capture a raw packet sample and validate it against the expected ingress packet format.","Ensure the producer's packet_mode and encryption settings match the consumer config."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    EdgeSocketQueuedRecord record = deserializer.deserializeRecord(rawPacket);\n} catch (EdgeSocketConnectorException e) {\n    if (e.getErrorCode() == EdgeSocketConnectorErrorCode.PACKET_DECODE_ERROR) {\n        // inspect e.getCause() and quarantine the raw packet\n    }\n}","preventionTips":["Pin matching packet schema versions on both ends.","Enable raw-frame logging at the sender to debug malformed packets.","Smoke-test the full pipeline (producer -> consumer) after version upgrades."],"tags":["deserialization","connector-edge-socket"],"backgroundTag":"protobuf-unmarshal-failed","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"}