{"record":{"id":"fbf3ddd8d30839f3","repo":"apache/seatunnel","slug":"flush-data-failed-fbf3dd","errorCode":"FLUSH_DATA_FAILED","errorMessage":"Writing items to Tablestore failed.","messagePattern":"Writing items to Tablestore failed\\.","errorType":"error_code","errorClass":"TablestoreConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-tablestore/src/main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/sink/TableStoreSinkClient.java","lineNumber":101,"sourceCode":"            return;\n        }\n        BatchWriteRowRequest batchWriteRowRequest = new BatchWriteRowRequest();\n        batchList.forEach(batchWriteRowRequest::addRowChange);\n        BatchWriteRowResponse response = syncClient.batchWriteRow(batchWriteRowRequest);\n\n        if (!response.isAllSucceed()) {\n            throw new TablestoreConnectorException(\n                    TablestoreConnectorErrorCode.WRITE_ROW_FAILED,\n                    String.format(\n                            \"Failed to send these rows of data: '%s'.\", response.getFailedRows()));\n        }\n\n        batchList.clear();\n    }\n\n    private void checkFlushException() {\n        if (flushException != null) {\n            throw new TablestoreConnectorException(\n                    CommonErrorCodeDeprecated.FLUSH_DATA_FAILED,\n                    \"Writing items to Tablestore failed.\",\n                    flushException);\n        }\n    }\n}\n","sourceCodeStart":83,"sourceCodeEnd":108,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-tablestore/src/main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/sink/TableStoreSinkClient.java#L83-L108","documentation":"Re-thrown wrapper for a previously captured asynchronous flush failure in TableStoreSinkClient. The writer defers the original failure (flushException) and raises it via checkFlushException() on subsequent write/flush calls so the pipeline fails deterministically after a background write error.","triggerScenarios":"A prior write/flush attempt recorded flushException (e.g. from an async callback failure), and a later call to write() or flush() invokes checkFlushException() which sees it is non-null.","commonSituations":"Network partitions to Tablestore endpoint; credential expiry mid-job; throttling during bursts; the original root cause is in the wrapped flushException cause, not this message.","solutions":["Read the cause (flushException) attached to this exception to find the original write failure.","Verify Tablestore endpoint/credentials (AccessKeyId/Secret) and network connectivity from the worker nodes.","Add retry/batch tuning to reduce throttling; check Tablestore monitoring for 5xx/throttle errors during the job window.","Restart the job after fixing the root cause; this error always accompanies an earlier failure."],"exampleFix":"// before\nTablestoreConnectorException e = ...; // only sees generic message\n// after\nThrowable root = e.getCause(); // inspect original flush failure\nlog.error(\"Original flush failure\", root);","handlingStrategy":"try-catch","validationCode":"// Check reachability before job start\ntry (Socket s = new Socket(host, 443)) { /* endpoint reachable */ }","typeGuard":null,"tryCatchPattern":"try {\n    sinkWriter.flush();\n} catch (TablestoreConnectorException e) {\n    Throwable root = e.getCause(); // original flush failure\n    log.error(\"Flush failed, root cause: {}\", root == null ? \"none\" : root.toString(), e);\n    throw e;\n}","preventionTips":["Always inspect getCause() — the real failure is in the wrapped flushException","Pre-validate endpoint, AccessKeyId/Secret before submitting the job","Enable Tablestore-side monitoring/alerts for throttling and 5xx","Avoid swallowing earlier write exceptions that seed flushException"],"tags":["tablestore","alibaba","deferred-exception","flush"],"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-23T08:17:48.524Z"}