{"record":{"id":"63faab1d70d159ea","repo":"apache/seatunnel","slug":"nebulagraph-sink-writer-is-in-a-failed-state","errorCode":null,"errorMessage":"NebulaGraph sink writer is in a failed state.","messagePattern":"NebulaGraph sink writer is in a failed state\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-nebulagraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/nebulagraph/sink/NebulaGraphSinkWriter.java","lineNumber":150,"sourceCode":"            buffer.clear();\n        } catch (IOException | RuntimeException e) {\n            failed = true;\n            throw new IOException(\n                    \"Failed to write \"\n                            + buffer.size()\n                            + \" vertices to NebulaGraph tag '\"\n                            + config.getTag()\n                            + \"'. The writer will not retry this batch during close.\",\n                    e);\n        }\n    }\n\n    private void ensureWritable() throws IOException {\n        if (closed) {\n            throw new IOException(\"NebulaGraph sink writer is already closed.\");\n        }\n        if (failed) {\n            throw new IOException(\"NebulaGraph sink writer is in a failed state.\");\n        }\n    }\n\n    private IOException unsupportedRowKind(RowKind rowKind) {\n        return new IOException(\n                \"Row kind \"\n                        + rowKind\n                        + \" is not supported in NebulaGraph \"\n                        + config.getWriteMode()\n                        + \" mode.\");\n    }\n}\n","sourceCodeStart":132,"sourceCodeEnd":163,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-nebulagraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/nebulagraph/sink/NebulaGraphSinkWriter.java#L132-L163","documentation":"The writer tracks a persistent failure with a 'failed' flag; once set (e.g. after a write/flush error the connector considers fatal), ensureWritable() rejects all subsequent write() and prepareCommit() calls with this IOException. The writer is poisoned by design: after an unrecoverable write failure it refuses more data rather than risk silently dropping or corrupting records.","triggerScenarios":"Any earlier write/flush to NebulaGraph threw an exception that the writer recorded by setting failed=true, followed by another write() or prepareCommit() call on the same writer instance.","commonSituations":"NebulaGraph outage or auth failure mid-job followed by retry attempts on the same writer; batch insert failing on a schema mismatch and the framework retrying the checkpoint flush; long-running job whose session expired.","solutions":["Fix the root cause of the initial failure (check logs for the original Nebula exception) before retrying","Restart the task so the writer is recreated from the sink factory/restore path","Validate Nebula schema/space and credentials so the first write does not fail","Treat the writer as terminal state in wrapping code: do not reuse it after a failed write"],"exampleFix":"// before\ntry { writer.write(row); } catch (Exception e) { /* swallow, keep writing */ }\n// after\ntry { writer.write(row); } catch (Exception e) {\n    throw new IOException(\"write failed, writer is poisoned\", e); // let framework recreate writer\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { writer.write(row); } catch (IOException e) { if (e.getMessage().contains(\"failed state\")) { throw new IOException(\"writer poisoned; task must restart\", e); } throw e; }","preventionTips":["Fix the first write failure's root cause before retrying on the same writer","Monitor Nebula health (space, schema, auth) to prevent initial failures","Do not swallow exceptions around writer.write — let the engine recreate the writer"],"tags":["java","sink","lifecycle","nebulagraph"],"backgroundTag":"invalid-state-transition","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"}