{"record":{"id":"8d5a68d1d57b6af0","repo":"apache/flink","slug":"unknown-op-value-s-the-debezium-avro-message","errorCode":null,"errorMessage":"Unknown \"op\" value \"%s\". The Debezium Avro message is '%s'","messagePattern":"Unknown \"op\" value \"(.+?)\"\\. The Debezium Avro message is '(.+?)'","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"flink-formats/flink-avro-confluent-registry/src/main/java/org/apache/flink/formats/avro/registry/confluent/debezium/DebeziumAvroDeserializationSchema.java","lineNumber":161,"sourceCode":"                out.collect(after);\n            } else if (OP_UPDATE.equals(op)) {\n                if (before == null) {\n                    throw new IllegalStateException(\n                            String.format(REPLICA_IDENTITY_EXCEPTION, \"UPDATE\"));\n                }\n                before.setRowKind(RowKind.UPDATE_BEFORE);\n                after.setRowKind(RowKind.UPDATE_AFTER);\n                out.collect(before);\n                out.collect(after);\n            } else if (OP_DELETE.equals(op)) {\n                if (before == null) {\n                    throw new IllegalStateException(\n                            String.format(REPLICA_IDENTITY_EXCEPTION, \"DELETE\"));\n                }\n                before.setRowKind(RowKind.DELETE);\n                out.collect(before);\n            } else {\n                throw new IOException(\n                        format(\n                                \"Unknown \\\"op\\\" value \\\"%s\\\". The Debezium Avro message is '%s'\",\n                                op, new String(message)));\n            }\n        } catch (Throwable t) {\n            // a big try catch to protect the processing.\n            throw new IOException(\"Can't deserialize Debezium Avro message.\", t);\n        }\n    }\n\n    @Override\n    public boolean isEndOfStream(RowData nextElement) {\n        return false;\n    }\n\n    @Override\n    public TypeInformation<RowData> getProducedType() {\n        return producedTypeInfo;","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-avro-confluent-registry/src/main/java/org/apache/flink/formats/avro/registry/confluent/debezium/DebeziumAvroDeserializationSchema.java#L143-L179","documentation":"Thrown when the 'op' field of a Debezium Avro message is not one of the recognized values ('r' read, 'c' create, 'u' update, 'd' delete) handled in DebeziumAvroDeserializationSchema.deserialize(). It signals the payload on the topic is not a well-formed Debezium envelope — either a different producer wrote Avro records to the topic, the schema was hand-rolled with wrong enum values, or the wrong schema/subject is being resolved. The full raw message is included to aid diagnosis.","triggerScenarios":"Pointing 'debezium-avro-confluent' format at a plain Avro topic or a topic produced by a non-Debezium producer; a custom Avro writer whose 'op' field uses values like 'UPDATE' instead of 'u'; schema registry resolving to the wrong subject (auto-registration naming mismatch) so the reader decodes bytes against an unrelated schema; truncated/corrupt records decoded into garbage.","commonSituations":"Topic naming drift after Debezium connector rename; mixing Debezium topics and application Avro topics under the same subject strategy; using value subjects in place of key subjects; a Confluent registry with RECORD_NAME strategy merging incompatible schemas.","solutions":["Inspect the failing raw message (included in the exception text) to see the actual 'op' value and envelope shape.","Verify the topic only contains Debezium-produced Avro events: kcat -C -t <topic> -p 0 with the registry Avro decoder.","Check the schema registry subject strategy and that the deserializer resolves the subject Debezium writes (default <topic>-value).","If a custom producer is involved, fix it to emit the Debezium envelope with op in {r,c,u,d} and matching field names."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"-- Before binding the table, sample the topic and assert op values:\n-- kcat -C -t <topic> -o -20 -s value=avro -r http://registry:8081 | jq -e '.payload.op | test(\"^[rcud]$\")'\n-- Non-zero exit => topic is not a valid Debezium envelope; do not start the job.","typeGuard":null,"tryCatchPattern":"catch (IOException e) { log raw message from exception text; quarantine the topic/offset and stop — this is a data-shape bug, retries will not help }","preventionTips":["Never mix Debezium and non-Debezium producers on one topic","Pin the registry subject strategy so readers resolve the exact Debezium subject","Add a staging consumer that validates the envelope before production jobs bind"],"tags":["debezium","avro","schema-registry","kafka","serialization"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}