{"record":{"id":"2c506c4fc57b80a4","repo":"apache/seatunnel","slug":"common-02-2c506c","errorCode":"COMMON-02","errorMessage":"<identifier> JSON convert/parse '<payload>' operation failed.","messagePattern":"<identifier> JSON convert/parse '<payload>' operation failed\\.","errorType":"error_code","errorClass":"org.apache.seatunnel.common.exception.SeaTunnelRuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-graphql/src/main/java/org/apache/seatunnel/connectors/seatunnel/graphql/sink/GraphQLSinkWriter.java","lineNumber":95,"sourceCode":"        Map<String, Object> requestBody = new HashMap<>();\n        requestBody.put(\"query\", query);\n        requestBody.put(\"variables\", variablesTemplate);\n\n        String body = gson.toJson(requestBody);\n\n        try {\n            HttpResponse response =\n                    httpClient.doPost(httpParameter.getUrl(), httpParameter.getHeaders(), body);\n            if (HttpResponse.STATUS_OK == response.getCode()) {\n                return;\n            }\n            log.error(\n                    \"http client execute exception, http response status code:[{}], content:[{}]\",\n                    response.getCode(),\n                    response.getContent());\n        } catch (Exception e) {\n            log.error(e.getMessage(), e);\n            throw CommonError.jsonOperationError(\"GraphQLSinkWriter\", body, e);\n        }\n    }\n\n    @Override\n    public void close() throws IOException {\n        if (Objects.nonNull(httpClient)) {\n            httpClient.close();\n        }\n    }\n}\n","sourceCodeStart":77,"sourceCodeEnd":106,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-graphql/src/main/java/org/apache/seatunnel/connectors/seatunnel/graphql/sink/GraphQLSinkWriter.java#L77-L106","documentation":"GraphQLSinkWriter.write executes the configured HTTP request against the GraphQL endpoint after serializing the body. Any exception thrown during request execution/response handling inside the try block is logged and rethrown as CommonError.jsonOperationError('GraphQLSinkWriter', body, e) (COMMON-02), i.e. a generic JSON-operation failure carrying the request body.","triggerScenarios":"The HTTP call in GraphQLSinkWriter.write (httpclient execute, response read) or body construction throws any Exception — e.g. connection failure, invalid response, or serialization problem with the request body.","commonSituations":"Unreachable or misconfigured GraphQL endpoint URL; network/firewall blocking the sink; authentication rejected by the endpoint; malformed row data producing an invalid GraphQL request body.","solutions":["Read the underlying cause in the stack trace to distinguish connect vs JSON vs HTTP errors","Verify the GraphQL endpoint URL and network reachability from the SeaTunnel worker","Check authentication credentials/headers configured for the sink","Validate that the row data matches the expected schema so the request body serializes correctly"],"exampleFix":"// before\nurl = \"http://my-graphql/\"\n// after\nurl = \"https://my-graphql-endpoint/graphql\" (with correct auth headers)","handlingStrategy":"try-catch","validationCode":"// Validate the GraphQL endpoint before running the sink\ncurl -s -o /dev/null -w \"%{http_code}\" -X POST \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"query\":\"{__typename}\"}' \"$GRAPHQL_URL\"","typeGuard":null,"tryCatchPattern":"try {\n    sinkWriter.write(row);\n} catch (SeaTunnelCommonException e) {\n    Throwable cause = e.getCause();\n    log.error(\"GraphQL write failed for body; cause class: \" + cause.getClass(), e);\n    throw e;\n}","preventionTips":["Verify the GraphQL endpoint URL and reachability from workers","Configure correct auth headers/credentials","Ensure row schema matches the GraphQL mutation body expectations","Read the cause in the logged stack trace to classify connect vs JSON failures"],"tags":["http","json","graphql","sink"],"backgroundTag":"json-marshal-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}