{"record":{"id":"d638b82aff56fccb","repo":"apache/seatunnel","slug":"write-records-failed-d638b8","errorCode":"WRITE_RECORDS_FAILED","errorMessage":"The number of retries was exceeded, writing records to StarRocks failed.","messagePattern":"The number of retries was exceeded, writing records to StarRocks failed\\.","errorType":"error_code","errorClass":"StarRocksConnectorException","httpStatus":null,"severity":"critical","filePath":"seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/StarRocksSinkManager.java","lineNumber":134,"sourceCode":"        StarRocksFlushTuple tuple = pendingFlush;\n        boolean loadSucceeded = false;\n        for (int i = 0; i <= sinkConfig.getMaxRetries(); i++) {\n            try {\n                Boolean successFlag = starrocksStreamLoadVisitor.doStreamLoad(tuple);\n                if (Boolean.TRUE.equals(successFlag)) {\n                    loadSucceeded = true;\n                    break;\n                }\n                throw new StarRocksConnectorException(\n                        StarRocksConnectorErrorCode.FLUSH_DATA_FAILED,\n                        String.format(\n                                \"Stream Load returned a non-success result for %s.%s with label [%s].\",\n                                sinkConfig.getDatabase(), sinkConfig.getTable(), tuple.getLabel()));\n            } catch (Exception e) {\n                log.warn(\"Writing records to StarRocks failed, retry times = {}\", i, e);\n\n                if (i >= sinkConfig.getMaxRetries()) {\n                    throw new StarRocksConnectorException(\n                            StarRocksConnectorErrorCode.WRITE_RECORDS_FAILED,\n                            \"The number of retries was exceeded, writing records to StarRocks failed.\",\n                            e);\n                }\n\n                if (e instanceof StarRocksConnectorException\n                        && ((StarRocksConnectorException) e).needReCreateLabel()) {\n                    String newLabel = createBatchLabel();\n                    log.warn(\n                            String.format(\n                                    \"Batch label changed from [%s] to [%s]\",\n                                    tuple.getLabel(), newLabel));\n                    tuple.setLabel(newLabel);\n                }\n\n                try {\n                    long backoff =\n                            Math.min(","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/StarRocksSinkManager.java#L116-L152","documentation":"Thrown in StarRocksSinkManager.flush() when the retry loop exhausts sinkConfig.getMaxRetries() attempts to write records via Stream Load. The originating exception is attached as the cause. At this point the batch is definitively failed and the task will fail; buffered records are not delivered.","triggerScenarios":"Every retry of doStreamLoad() throws (network errors, HTTP failures, non-success statuses) until i >= maxRetries; reached from write() (batch full) or close() (final flush).","commonSituations":"StarRocks cluster down or FE unreachable during the whole retry window; wrong load_url port; table locked or schema mismatch persisting across retries; long StarRocks ingestion backpressure.","solutions":["Check the wrapped cause ('Writing records to StarRocks failed, retry times = N' warnings) to find the root failure.","Increase max-retries and backoff so longer StarRocks outages can be ridden out.","Fix connectivity: verify load_url hosts, ports, firewalls, and DNS resolution.","Ensure the target table exists and the row schema matches; fix and restart the job (checkpoint recovery will replay)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before job start\ncurl -s http://<fe>:8030/api/health\nSHOW STREAM LOAD FROM <db>; // confirm cluster accepts loads","typeGuard":null,"tryCatchPattern":"try {\n    sink.close();\n} catch (StarRocksConnectorException e) {\n    if (e.getErrorCode() == StarRocksConnectorErrorCode.WRITE_RECORDS_FAILED) {\n        log.error(\"Retries exhausted\", e.getCause()); // root cause is in the cause chain\n    }\n}","preventionTips":["Always read the chained cause — this error is a wrapper over the real failure","Set max_retries high enough to survive short StarRocks outages","Alert on StarRocks FE/BE availability rather than discovering it via sink failure"],"tags":["starrocks","stream-load","retry-exhausted","sink"],"backgroundTag":"retry-limit-exceeded","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"}