{"record":{"id":"fd3c3e00ff2d4f30","repo":"apache/seatunnel","slug":"nebulagraph-rejected-the-write-with-code-errorco","errorCode":null,"errorMessage":"NebulaGraph rejected the write with code ${errorCode}: ${errorMessage}","messagePattern":"NebulaGraph rejected the write with code (.+?): (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-nebulagraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/nebulagraph/client/SessionPoolNebulaGraphClient.java","lineNumber":67,"sourceCode":"                        .setReconnect(true);\n        try {\n            this.sessionPool = new SessionPool(poolConfig);\n        } catch (RuntimeException e) {\n            throw new NebulaGraphConnectorException(\n                    NebulaGraphConnectorErrorCode.CONNECT_FAILED,\n                    \"Unable to initialize a NebulaGraph session pool for space '\"\n                            + config.getSpace()\n                            + \"'.\",\n                    e);\n        }\n    }\n\n    @Override\n    public void execute(String statement, Map<String, Object> parameters) throws IOException {\n        try {\n            ResultSet result = sessionPool.execute(statement, parameters);\n            if (!result.isSucceeded()) {\n                throw new IOException(\n                        \"NebulaGraph rejected the write with code \"\n                                + result.getErrorCode()\n                                + \": \"\n                                + result.getErrorMessage());\n            }\n        } catch (IOException e) {\n            throw e;\n        } catch (Exception e) {\n            throw new IOException(\"NebulaGraph write request failed.\", e);\n        }\n    }\n\n    @Override\n    public void close() {\n        sessionPool.close();\n    }\n}\n","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-nebulagraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/nebulagraph/client/SessionPoolNebulaGraphClient.java#L49-L85","documentation":"SessionPoolNebulaGraphClient.execute runs an nGQL statement with parameters via the session pool. If NebulaGraph returns a result set whose isSucceeded() is false, the client throws an IOException embedding the server's error code and message. This is a server-side rejection of the statement, not a transport failure.","triggerScenarios":"sessionPool.execute returns an error ResultSet — invalid nGQL, schema mismatch (tag/property not found), wrong value types, leader changes, space not used, session expired.","commonSituations":"See trigger scenarios.","solutions":["Read the embedded errorCode/errorMessage — it states the server-side reason (e.g. Tag not existed, Session expired)","Verify the tag name and property names/types in the config match the Nebula schema (DESCRIBE TAG)","Check for leader-change/storage issues in Nebula logs; retry after the cluster stabilizes","Ensure the space is correct and the session pool is configured with the right space"],"exampleFix":"// before\nresult = sessionPool.execute(\"INSERT VERTEX person(name) VALUES ...\" ) // 'nmae' typo\n// after\nresult = sessionPool.execute(\"INSERT VERTEX person(name) VALUES ...\") // match DESCRIBE TAG person","handlingStrategy":"try-catch","validationCode":"// preflight schema check via console\n// USE my_space; DESCRIBE TAG my_tag;  -- confirm property names/types","typeGuard":null,"tryCatchPattern":"try {\n    client.execute(statement, params);\n} catch (IOException e) {\n    if (e.getMessage().contains(\"Session expired\")) {\n        reconnectAndRetry();\n    } else {\n        LOG.error(\"Nebula rejected statement: {}\", e.getMessage());\n        throw e;\n    }\n}","preventionTips":["Match tag/property names and types against DESCRIBE TAG output","Keep sessions alive within idle timeouts","Monitor Nebula leader changes; expect transient rejections during rebalance","Test statements in nebula-console before deploying"],"tags":["nebulagraph","write-failed","server-error","ngql"],"backgroundTag":"database-write-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"}