apache/seatunnel · error · IOException

NebulaGraph rejected the write with code ${errorCode}: ${err

Error message

NebulaGraph rejected the write with code ${errorCode}: ${errorMessage}

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-nebulagraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/nebulagraph/client/SessionPoolNebulaGraphClient.java:67

                        .setReconnect(true);
        try {
            this.sessionPool = new SessionPool(poolConfig);
        } catch (RuntimeException e) {
            throw new NebulaGraphConnectorException(
                    NebulaGraphConnectorErrorCode.CONNECT_FAILED,
                    "Unable to initialize a NebulaGraph session pool for space '"
                            + config.getSpace()
                            + "'.",
                    e);
        }
    }

    @Override
    public void execute(String statement, Map<String, Object> parameters) throws IOException {
        try {
            ResultSet result = sessionPool.execute(statement, parameters);
            if (!result.isSucceeded()) {
                throw new IOException(
                        "NebulaGraph rejected the write with code "
                                + result.getErrorCode()
                                + ": "
                                + result.getErrorMessage());
            }
        } catch (IOException e) {
            throw e;
        } catch (Exception e) {
            throw new IOException("NebulaGraph write request failed.", e);
        }
    }

    @Override
    public void close() {
        sessionPool.close();
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Read the embedded errorCode/errorMessage — it states the server-side reason (e.g. Tag not existed, Session expired)
  2. Verify the tag name and property names/types in the config match the Nebula schema (DESCRIBE TAG)
  3. Check for leader-change/storage issues in Nebula logs; retry after the cluster stabilizes
  4. Ensure the space is correct and the session pool is configured with the right space

Example fix

// before
result = sessionPool.execute("INSERT VERTEX person(name) VALUES ..." ) // 'nmae' typo
// after
result = sessionPool.execute("INSERT VERTEX person(name) VALUES ...") // match DESCRIBE TAG person
Defensive patterns

Strategy: try-catch

Validate before calling

// preflight schema check via console
// USE my_space; DESCRIBE TAG my_tag;  -- confirm property names/types

Try / catch

try {
    client.execute(statement, params);
} catch (IOException e) {
    if (e.getMessage().contains("Session expired")) {
        reconnectAndRetry();
    } else {
        LOG.error("Nebula rejected statement: {}", e.getMessage());
        throw e;
    }
}

Prevention

When it happens

Trigger: sessionPool.execute returns an error ResultSet — invalid nGQL, schema mismatch (tag/property not found), wrong value types, leader changes, space not used, session expired.

Common situations: See trigger scenarios.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/fd3c3e00ff2d4f30. Report an issue: GitHub.