apache/seatunnel · error · org.apache.seatunnel.common.exception.SeaTunnelRuntimeException
COMMON-02
COMMON-02
Error message
<identifier> JSON convert/parse '<payload>' operation failed.
What it means
GoogleSheetsDeserializer.deserializeRow converts each row map to a JSON string with Jackson's ObjectMapper and hands it to the configured SeaTunnelDeserializationSchema. If Jackson cannot serialize the row map (JsonProcessingException), the connector wraps it in a CommonError JSON-operation error (COMMON-02) naming the connector and payload. This indicates the row data could not be converted to the JSON representation the deserialization schema expects.
Source
Thrown at seatunnel-connectors-v2/connector-google-sheets/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/sheets/deserialize/GoogleSheetsDeserializer.java:58
String[] fields, DeserializationSchema<SeaTunnelRow> deserializationSchema) {
this.fields = fields;
this.deserializationSchema = deserializationSchema;
}
@Override
public SeaTunnelRow deserializeRow(List<Object> row) {
Map<String, Object> map = new HashMap<>();
for (int i = 0; i < row.size(); i++) {
if (i < fields.length) {
map.put(fields[i], row.get(i));
}
}
try {
String rowStr = objectMapper.writeValueAsString(map);
return deserializationSchema.deserialize(rowStr.getBytes());
} catch (JsonProcessingException e) {
throw CommonError.jsonOperationError("GoogleSheets", map.toString(), e);
} catch (IOException e) {
throw GoogleSheetsError.deserializeError(map.toString(), e);
}
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Inspect the payload printed in the error message for values that cannot be serialized to JSON
- Upgrade/align the Jackson (jackson-databind) version used by the connector
- Check any custom deserializationSchema implementation for content that breaks serialization
- Enable JsonUtils/ObjectMapper forgiving features (e.g. FAIL_ON_EMPTY_BEANS=false) if bean serialization is the issue
Example fix
// before return deserializationSchema.deserialize(rowStr.getBytes()); // after String rowStr = JsonUtils.toJsonString(map); return deserializationSchema.deserialize(rowStr.getBytes(StandardCharsets.UTF_8));
Defensive patterns
Strategy: try-catch
Validate before calling
// Java: verify the map is JSON-serializable before calling deserializeRow
try {
new ObjectMapper().writeValueAsString(rowMap);
} catch (JsonProcessingException e) {
throw new IllegalStateException("Row not serializable: " + e.getMessage(), e);
} Type guard
boolean isJsonSerializable(Object o) {
try { new ObjectMapper().writeValueAsString(o); return true; }
catch (JsonProcessingException e) { return false; }
} Try / catch
try {
deserializer.deserializeRow(rowMap);
} catch (SeaTunnelCommonException e) {
if (e.getCommonCode() == CommonErrorCode.JSON_OPERATION_FAILED) {
log.error("Unserializable Google Sheets row payload", e);
// skip or dead-letter the row
} else { throw e; }
} Prevention
- Keep cell values as plain strings/numbers before deserialization
- Pin a known-good jackson-databind version in the classpath
- Disable FAIL_ON_EMPTY_BEANS on the ObjectMapper
- Test the deserialization schema with representative sheet data
When it happens
Trigger: objectMapper.writeValueAsString(map) throws JsonProcessingException while serializing a Google Sheets row map, e.g. the map contains a value Jackson cannot serialize (unwritable/self-referencing object) or a serialization feature blocks the write.
Common situations: Custom/corrupted cell values producing non-serializable objects; running with a Jackson version or configuration that fails on certain map values; debugging with modified deserialization code that injects unusual payloads.
Understand the failure class
Background: json.Marshal / "failed to marshal" errors in Go: why "unsupported type" happens and how to fix it — this error's family across 22 libraries.
Related errors
- Failed to convert row to JSON
- JSON_OPERATION_FAILED
- Failed to serialize EdgeIngressPacket to JSON
- Failed to serialize WAL payload to packet wire format
- UNSUPPORTED_DATA_TYPE
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/758b16eb46624aaa.
Report an issue: GitHub.