apache/seatunnel · error · IllegalStateException

Unknown operation type

Error message

Unknown operation type '%s'.

What it means

Thrown by OggJsonDeserializationSchema.deserializeMessage when an Oracle GoldenGate JSON message carries an operation type ('op') that is not one of the supported values (I=insert, U=update, D=delete). The schema switches on the op field and the default branch rejects anything else. If ignoreParseErrors is false, the resulting RuntimeException is wrapped by CommonError.jsonOperationError.

Solutions

  1. Inspect the failing message (printed in the wrapped jsonOperationError) and check its 'op' field value against supported I/U/D values
  2. Fix the upstream OGG/Replicat configuration so it emits only insert/update/delete operations
  3. Filter or route unknown-op messages to a dead-letter topic before feeding this connector
  4. If the op values are legitimately parse errors, set format.ignore-parse-errors=true so bad records are skipped instead of failing the job

Example fix

// before (HOCON job config)
format = ogg-json
// messages with unknown ops fail the job

// after
format = ogg-json
format.ignore-parse-errors = true
Defensive patterns

Strategy: validation

Validate before calling

String op = jsonNode.path("op").asText("");
if (!op.equals("I") && !op.equals("U") && !op.equals("D")) {
    // route to dead-letter / skip before feeding the connector
}

Type guard

boolean isSupportedOggOp(String op) {
    return "I".equals(op) || "U".equals(op) || "D".equals(op);
}

Try / catch

try {
    deserialize(message, out);
} catch (RuntimeException e) {
    log.warn("Skipping unparseable ogg-json record: {}", message, e);
    // dead-letter or drop the record
}

Prevention

When it happens

Trigger: Deserializing an OGG JSON message whose 'op' field is missing, empty, or set to an unexpected value (e.g. 'R' for truncate, 'T', lowercase 'i', or a custom replication op). Occurs inside deserialize -> deserializeMessage during source record processing.

Common situations: OGG trail/replicat configured with message types the connector does not model; upstream tool emitting non-standard JSON; op field renamed or dropped by an intermediate Kafka topic transformation; case mismatch writing lowercase op values.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/2379ed47c3aefca3. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/ogg/OggJsonDeserializationSchema.java:231

                                String.format(REPLICA_IDENTITY_EXCEPTION, "DELETE"));
                    }
                    // Gets the data for the DELETE BEFORE operation
                    SeaTunnelRow beforeDelete = convertJsonNode(dataBeforeDel);
                    if (beforeDelete == null) {
                        throw new IllegalStateException(
                                String.format(REPLICA_IDENTITY_EXCEPTION, "DELETE"));
                    }
                    beforeDelete.setRowKind(RowKind.DELETE);
                    if (tablePath != null) {
                        beforeDelete.setTableId(tablePath.toString());
                    }
                    if (tsNode != null) {
                        MetadataUtil.setEventTime(beforeDelete, ts);
                    }
                    out.collect(beforeDelete);
                    break;
                default:
                    throw new IllegalStateException(
                            String.format("Unknown operation type '%s'.", op));
            }

        } catch (RuntimeException e) {
            if (!ignoreParseErrors) {
                throw CommonError.jsonOperationError(FORMAT, jsonNode.toString(), e);
            }
        }
    }

    private ObjectNode convertBytes(byte[] message) throws SeaTunnelRuntimeException {
        try {
            return (ObjectNode) jsonDeserializer.deserializeToJsonNode(message);
        } catch (Throwable t) {
            throw CommonError.jsonOperationError(FORMAT, new String(message), t);
        }
    }

View on GitHub (pinned to cf67b549a7)