{"record":{"id":"0258a3e3a1391217","repo":"apache/seatunnel","slug":"convert-to-connector-type-error-simple","errorCode":"CONVERT_TO_CONNECTOR_TYPE_ERROR_SIMPLE","errorMessage":"Failed to deserialize JSON '%s'.","messagePattern":"Failed to deserialize JSON '(.+?)'\\.","errorType":"error_code","errorClass":"SeaTunnelJsonFormatException","httpStatus":null,"severity":"error","filePath":"seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/maxwell/MaxWellJsonDeserializationSchema.java","lineNumber":198,"sourceCode":"        } else {\n            if (!ignoreParseErrors) {\n                throw new SeaTunnelJsonFormatException(\n                        CommonErrorCode.UNSUPPORTED_DATA_TYPE,\n                        format(\n                                \"Unknown \\\"type\\\" value \\\"%s\\\". The MaxWell JSON message is '%s'\",\n                                type, new String(message)));\n            }\n        }\n    }\n\n    private JsonNode convertBytes(byte[] message) {\n        try {\n            return jsonDeserializer.deserializeToJsonNode(message);\n        } catch (Exception t) {\n            if (ignoreParseErrors) {\n                return null;\n            }\n            throw new SeaTunnelJsonFormatException(\n                    CommonErrorCode.CONVERT_TO_CONNECTOR_TYPE_ERROR_SIMPLE,\n                    String.format(\"Failed to deserialize JSON '%s'.\", new String(message)),\n                    t);\n        }\n    }\n\n    private SeaTunnelRow convertJsonNode(JsonNode root) {\n        return jsonDeserializer.convertToRowData(root);\n    }\n\n    private static SeaTunnelRowType createJsonRowType(SeaTunnelRowType physicalDataType) {\n        // MaxWell JSON contains other information, e.g. \"ts\", \"sql\", but we don't need them\n        return physicalDataType;\n    }\n\n    // ------------------------------------------------------------------------------------------\n    // Builder\n    // ------------------------------------------------------------------------------------------","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/maxwell/MaxWellJsonDeserializationSchema.java#L180-L216","documentation":"convertBytes wraps the raw JSON parse step of Maxwell message handling: jsonDeserializer attempts to parse the byte[] into a JsonNode. If parsing fails and ignoreParseErrors is false, the raw bytes are wrapped in a SeaTunnelJsonFormatException (CONVERT_TO_CONNECTOR_TYPE_ERROR_SIMPLE) with the original exception attached.","triggerScenarios":"deserialize → convertBytes is handed byte[] that is not valid JSON (truncated record, non-UTF8 bytes, a tombstone/null payload mishandled upstream, or a completely different serialization format in the topic).","commonSituations":"Kafka topic polluted by other producers; compacted topics with tombstone records; message size limits truncating payloads; charset/encoding corruption during transport; users pointing the CDC source at the wrong topic.","solutions":["Enable format.ignore-parse-errors=true so bad records are skipped instead of failing the job","Inspect the raw message (printed in the error) and clean/repair the topic or repartition data","Ensure the source points at the correct Maxwell JSON topic and that no tombstones/nulls reach the parser","Validate producer encoding (UTF-8) and message completeness upstream"],"exampleFix":"// before: job fails on malformed kafka record\n// after\nsource {\n  Kafka {\n    ...\n    format = json\n    format.ignore-parse-errors = true\n  }\n}","handlingStrategy":"validation","validationCode":"// pre-validate bytes are valid UTF-8 JSON before deserialization\ntry {\n    new ObjectMapper().readTree(message);\n} catch (IOException e) {\n    log.warn(\"Skipping non-JSON kafka record\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"try {\n    schema.deserialize(message, out);\n} catch (SeaTunnelJsonFormatException e) {\n    if (e.getCause() != null) log.warn(\"Malformed maxwell json skipped: {}\", e.getCause().getMessage());\n}","preventionTips":["Enable format.ignore-parse-errors=true on shared/dirty topics","Exclude tombstone records before the CDC source (compacted-topic handling)","Verify producers write valid UTF-8 JSON and complete messages"],"tags":["json","kafka","maxwell","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-14T05:17:10.506Z"}