{"record":{"id":"b755f336a59fb56e","repo":"apache/seatunnel","slug":"common-02-b755f3","errorCode":"COMMON-02","errorMessage":"Json JSON convert/parse '<payload>' operation failed.","messagePattern":"Json JSON convert/parse '<payload>' operation failed\\.","errorType":"error_code","errorClass":"SeaTunnelRuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/debezium/DebeziumJsonDeserializationSchema.java","lineNumber":110,"sourceCode":"    @Override\n    public void deserialize(byte[] message, Collector<SeaTunnelRow> out) {\n        deserializeMessage(message, out, tablePath);\n    }\n\n    public void deserializeMessage(\n            byte[] message, Collector<SeaTunnelRow> out, TablePath tablePath) {\n        if (message == null || message.length == 0) {\n            // skip tombstone messages\n            return;\n        }\n\n        try {\n            JsonNode payload = getPayload(jsonDeserializer.deserializeToJsonNode(message));\n            parsePayload(out, tablePath, payload);\n        } catch (Exception e) {\n            // a big try catch to protect the processing.\n            if (!ignoreParseErrors) {\n                throw CommonError.jsonOperationError(FORMAT, new String(message), e);\n            }\n        }\n    }\n\n    public void parsePayload(Collector<SeaTunnelRow> out, JsonNode payload) throws IOException {\n        parsePayload(out, tablePath, payload);\n    }\n\n    private void parsePayload(Collector<SeaTunnelRow> out, TablePath tablePath, JsonNode payload)\n            throws IOException {\n        String op = payload.get(OP_KEY).asText();\n        JsonNode tsNode = payload.get(DATA_TS);\n\n        switch (op) {\n            case OP_CREATE:\n            case OP_READ:\n                SeaTunnelRow insert = debeziumRowConverter.parse(payload.get(DATA_AFTER));\n                insert.setRowKind(RowKind.INSERT);","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/debezium/DebeziumJsonDeserializationSchema.java#L92-L128","documentation":"DebeziumJsonDeserializationSchema.deserializeMessage wraps any Exception from parsing the Debezium envelope and converting the payload to a SeaTunnelRow into jsonOperationError, unless ignoreParseErrors is enabled. The raw message is embedded in the message. It indicates the Debezium JSON message (before/after/op/source/ts_ms) was missing fields, had unexpected shapes, or the value converters rejected data.","triggerScenarios":"deserializeMessage receives bytes whose JSON either fails envelope parsing (getPayload) or whose before/after fields do not match the configured database schema during parsePayload: missing 'op', tombstone events, schema-registry style wrapping, or type-incompatible values.","commonSituations":"Debezium version change changing envelope layout (e.g. optional 'source' fields); snapshot/tombstone (null-value) records reaching the connector; column type changes after upstream DDL; consumers configured with 'debezium-json' format against raw JSON topics.","solutions":["Inspect the payload in the error and verify it is a valid Debezium change-event envelope with before/after/op","Filter out tombstones and non-DML records (topic cleanup policy / SMT settings on the Debezium side)","Update the connector's database schema to match upstream DDL changes, then restart","Set debezium-json ignore-parse-errors=true if occasional dirty events should be skipped"],"exampleFix":"// before: raw topic parsed as debezium-json\nformat = JsonFormat\n// after: ensure events are real Debezium envelopes or switch format\nDebeziumJsonDeserializationSchema.builder(databaseSchema,...).setIgnoreParseErrors(true).build(); // and enable Debezium's ExtractNewRecordState only if schema matches","handlingStrategy":"try-catch","validationCode":"JsonNode root = mapper.readTree(message);\nboolean isDebeziumEvent = root.isObject() && root.has(\"op\") && (root.has(\"before\") || root.has(\"after\"));","typeGuard":"boolean isDebeziumEnvelope(JsonNode n) {\n    return n != null && n.isObject() && n.hasNonNull(\"op\")\n        && (n.has(\"before\") || n.has(\"after\"));\n}","tryCatchPattern":"try {\n    schema.deserialize(message, out);\n} catch (SeaTunnelRuntimeException e) {\n    log.warn(\"Skip malformed debezium event: {}\", new String(message), e);\n}","preventionTips":["Enable ignore-parse-errors for production CDC jobs","Exclude tombstone records (Debezium tombstones.on.delete=false)","Keep database schema in connector config in sync with upstream DDL","Confirm topic format matches 'debezium-json' exactly"],"tags":["json","cdc","debezium","deserialization"],"backgroundTag":"json-parse-error","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}