{"record":{"id":"58fee3c399e299f7","repo":"apache/seatunnel","slug":"common-02","errorCode":"COMMON-02","errorMessage":"<identifier> JSON convert/parse '<payload>' operation failed.","messagePattern":"<identifier> JSON convert/parse '<payload>' operation failed\\.","errorType":"error_code","errorClass":"SeaTunnelRuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/excecutor/AssertExecutor.java","lineNumber":186,"sourceCode":"\n    private boolean compareValue(\n            Object value,\n            SeaTunnelDataType<?> type,\n            AssertFieldRule.AssertRule valueRule,\n            String fieldName) {\n        Object config = valueRule.getEqualTo();\n        String confJsonStr = JsonUtils.toJsonString(config);\n\n        JsonToRowConverters converters = new JsonToRowConverters(true, false);\n        JsonToRowConverters.JsonToObjectConverter converter = converters.createConverter(type);\n\n        Object confValue;\n        try {\n            confValue =\n                    converter.convert(\n                            JsonUtils.stringToJsonNode(JsonUtils.toJsonString(config)), fieldName);\n        } catch (IOException e) {\n            throw CommonError.jsonOperationError(\"Assert\", confJsonStr, e);\n        }\n        return compareValue(value, type, confValue);\n    }\n\n    private boolean compareValue(Object value, SeaTunnelDataType<?> type, Object confValue) {\n        switch (type.getSqlType()) {\n            case ROW:\n                {\n                    return compareRowValue(\n                            (SeaTunnelRow) value,\n                            (SeaTunnelRowType) type,\n                            (SeaTunnelRow) confValue);\n                }\n            case ARRAY:\n                {\n                    return compareArrayValue(\n                            (Object[]) value, (ArrayType<?, ?>) type, (Object[]) confValue);\n                }","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-assert/src/main/java/org/apache/seatunnel/connectors/seatunnel/assertion/excecutor/AssertExecutor.java#L168-L204","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before (config)\nAssertSink {\n  rules = { field_name = id, rules = [{ field_type = int, field_value = \"not-a-number\" }] }\n}\n\n// after\nAssertSink {\n  rules = { field_name = id, rules = [{ field_type = int, field_value = 42 }] }\n}","handlingStrategy":"validation","validationCode":"java\n// Validate assertion rule JSON before running the job\nJsonNode rules = JsonUtils.stringToJsonNode(ruleConfigJson);\nif (rules == null || !rules.isObject()) {\n    throw new IllegalArgumentException(\"Invalid Assert rule JSON: \" + ruleConfigJson);\n}","typeGuard":null,"tryCatchPattern":"java\ntry {\n    boolean ok = assertExecutor.pass(value, type, config);\n} catch (SeaTunnelException e) {\n    if (e.getMessage().contains(\"JSON convert/parse\")) {\n        // log payload and fix assertion rule config\n    } else {\n        throw e;\n    }\n}","preventionTips":["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."],"tags":["assert","json","config","sea-tunnel"],"backgroundTag":"json-parse-error","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}