{"record":{"id":"f267db5984598f6b","repo":"apache/seatunnel","slug":"unknown-operation-type-op","errorCode":null,"errorMessage":"Unknown operation type '${op}'.","messagePattern":"Unknown operation type '(.+?)'\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/canal/CanalJsonDeserializationSchema.java","lineNumber":210,"sourceCode":"                        out.collect(before);\n                        out.collect(after);\n                    }\n                    break;\n                case OP_DELETE:\n                    for (int i = 0; i < dataNode.size(); i++) {\n                        SeaTunnelRow row = convertJsonNode(dataNode.get(i));\n                        row.setRowKind(RowKind.DELETE);\n                        if (tablePath != null && !tablePath.toString().isEmpty()) {\n                            row.setTableId(tablePath.toString());\n                        }\n                        if (tsNode != null) {\n                            MetadataUtil.setEventTime(row, tsNode.asLong());\n                        }\n                        out.collect(row);\n                    }\n                    break;\n                default:\n                    throw new IllegalStateException(\n                            String.format(\"Unknown operation type '%s'.\", op));\n            }\n        } catch (RuntimeException e) {\n            if (!ignoreParseErrors) {\n                throw CommonError.jsonOperationError(FORMAT, jsonNode.toString(), e);\n            }\n        }\n    }\n\n    private ObjectNode convertBytes(byte[] message) throws SeaTunnelRuntimeException {\n        if (message == null || message.length == 0) {\n            return null;\n        }\n\n        try {\n            return (ObjectNode) jsonDeserializer.deserializeToJsonNode(message);\n        } catch (Throwable t) {\n            if (!ignoreParseErrors) {","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/canal/CanalJsonDeserializationSchema.java#L192-L228","documentation":"Canal JSON events carry an 'op' field (INSERT/UPDATE/DELETE/QUERY/CREATE/ALTER are recognized). When op holds any other value, the deserializer's switch falls through to default and throws IllegalStateException. The enclosing catch re-wraps it via CommonError.jsonOperationError unless ignoreParseErrors is enabled.","triggerScenarios":"Consuming a Canal JSON message whose op field contains an unrecognized value (new Canal op types, corrupted op field, non-Canal JSON injected into the stream, or truncated/garbled messages).","commonSituations":"Canal version introducing new op codes not yet supported by this SeaTunnel format; unrelated producers writing to the same topic/queue; message corruption or charset issues mangling the op field.","solutions":["Identify the unexpected op value in the message (logged in the jsonOperationError) and check your Canal server version for new op types","Upgrade SeaTunnel's seatunnel-format-json to a version supporting the new Canal op types","Filter or route unknown-op messages upstream before feeding the deserializer","Set json.ignore-parse-errors=true to skip unparseable messages instead of failing the job"],"exampleFix":"// before (config)\njson {\n  ignore-parse-errors = false\n}\n// after\njson {\n  ignore-parse-errors = true\n  timestamp-format.standard = \"SQL\"\n}","handlingStrategy":"validation","validationCode":"String op = node.path(\"op\").asText(\"\");\nif (!op.matches(\"INSERT|UPDATE|DELETE|QUERY|CREATE|ALTER\")) {\n    throw new IllegalStateException(\"Unrecognized Canal op: \" + op);\n}","typeGuard":"boolean knownOp = Set.of(\"INSERT\",\"UPDATE\",\"DELETE\",\"QUERY\",\"CREATE\",\"ALTER\").contains(node.path(\"op\").asText(\"\"));","tryCatchPattern":"try { canalJsonSchema.deserialize(message, out); } catch (SeaTunnelJsonFormatException e) { log.warn(\"Skipping message with unknown op\"); /* or rethrow depending on ignore-parse-errors */ }","preventionTips":["Verify Canal server and SeaTunnel format versions are compatible for op codes","Enable json.ignore-parse-errors=true to survive malformed foreign messages","Isolate the Canal topic/queue from other producers writing arbitrary JSON","Log full offending messages (jsonOperationError includes the payload) to diagnose op drift"],"tags":["json","canal","cdc","unknown-operation","malformed-event"],"backgroundTag":"invalid-enum-value","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"}