apache/seatunnel · error · SeaTunnelRuntimeException
COMMON-02
COMMON-02
Error message
<identifier> JSON convert/parse '<payload>' operation failed.
What it means
The Assert sink's AssertExecutor.compareValue() wraps assertion config parsing: it converts the assertion config JSON into the expected value via a type converter. If any IOException occurs during that JSON conversion/parse, CommonError.jsonOperationError("Assert", confJsonStr, e) (COMMON-02) is thrown, reporting that the Assert connector failed a JSON convert/parse operation on the given payload.
Solutions
- Validate the assertion rule JSON in your config file — ensure each rule is well-formed and matches the expected schema for the field type.
- Check the wrapped IOException (cause) in the stack trace to find the exact JSON parse failure point.
- Ensure rule value types in config match the column types being asserted (e.g. numeric rules for numeric columns).
- Escape special characters in configured string values and re-run the job.
Example fix
// before (config)
AssertSink {
rules = { field_name = id, rules = [{ field_type = int, field_value = "not-a-number" }] }
}
// after
AssertSink {
rules = { field_name = id, rules = [{ field_type = int, field_value = 42 }] }
} Defensive patterns
Strategy: validation
Validate before calling
java
// Validate assertion rule JSON before running the job
JsonNode rules = JsonUtils.stringToJsonNode(ruleConfigJson);
if (rules == null || !rules.isObject()) {
throw new IllegalArgumentException("Invalid Assert rule JSON: " + ruleConfigJson);
} Try / catch
java
try {
boolean ok = assertExecutor.pass(value, type, config);
} catch (SeaTunnelException e) {
if (e.getMessage().contains("JSON convert/parse")) {
// log payload and fix assertion rule config
} else {
throw e;
}
} Prevention
- Validate rule JSON structure and value types in CI before deploying configs.
- Match rule field_type to the actual column type.
- Avoid hand-editing config JSON without a schema check.
- Escape special characters in configured string rules.
When it happens
Trigger: Calling AssertExecutor.pass() with a rule config whose JSON cannot be converted for the given field name — e.g. JsonUtils.stringToJsonNode(JsonUtils.toJsonString(config)) or converter.convert() raising IOException for malformed or incompatible JSON content.
Common situations: Malformed assertion rules in the seatunnel config file (bad JSON structure for field rules); rule type mismatched with the field's declared type so the converter fails; special characters or encoding issues in configured rule values.
Understand the failure class
Background: JSON parse error: "Unexpected token" / "not valid JSON" / "failed to parse" — what JSON parsers are really complaining about — this error's family across 45 libraries.
Related errors
- ILLEGAL_ARGUMENT
- Invalid sort JSON:
- Json file does not support this compress type
- accessId and accesskey must be provided when sts_token is…
- Agent config is not a readable file
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/58fee3c399e299f7.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/excecutor/AssertExecutor.java:186
private boolean compareValue(
Object value,
SeaTunnelDataType<?> type,
AssertFieldRule.AssertRule valueRule,
String fieldName) {
Object config = valueRule.getEqualTo();
String confJsonStr = JsonUtils.toJsonString(config);
JsonToRowConverters converters = new JsonToRowConverters(true, false);
JsonToRowConverters.JsonToObjectConverter converter = converters.createConverter(type);
Object confValue;
try {
confValue =
converter.convert(
JsonUtils.stringToJsonNode(JsonUtils.toJsonString(config)), fieldName);
} catch (IOException e) {
throw CommonError.jsonOperationError("Assert", confJsonStr, e);
}
return compareValue(value, type, confValue);
}
private boolean compareValue(Object value, SeaTunnelDataType<?> type, Object confValue) {
switch (type.getSqlType()) {
case ROW:
{
return compareRowValue(
(SeaTunnelRow) value,
(SeaTunnelRowType) type,
(SeaTunnelRow) confValue);
}
case ARRAY:
{
return compareArrayValue(
(Object[]) value, (ArrayType<?, ?>) type, (Object[]) confValue);
}View on GitHub (pinned to cf67b549a7)