{"record":{"id":"086b5a3d5876c1c2","repo":"apache/seatunnel","slug":"flush-data-failed-086b5a","errorCode":"FLUSH_DATA_FAILED","errorMessage":"Stream Load returned a non-success result for %s.%s with label [%s].","messagePattern":"Stream Load returned a non-success result for (.+?)\\.(.+?) with label \\[(.+?)\\]\\.","errorType":"error_code","errorClass":"StarRocksConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/StarRocksSinkManager.java","lineNumber":125,"sourceCode":"        checkFlushException();\n        if (pendingFlush == null) {\n            if (batchList.isEmpty()) {\n                return;\n            }\n            pendingFlush =\n                    new StarRocksFlushTuple(\n                            createBatchLabel(), batchBytesSize, new ArrayList<>(batchList));\n        }\n        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(","sourceCodeStart":107,"sourceCodeEnd":143,"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#L107-L143","documentation":"Thrown in StarRocksSinkManager.flush() when starrocksStreamLoadVisitor.doStreamLoad() completes but reports a non-success result (returns false instead of true). The sink retries the Stream Load up to maxRetries times, and each failed attempt raises this FLUSH_DATA_FAILED error. It indicates the load request reached StarRocks but StarRocks did not accept/commit it on that attempt.","triggerScenarios":"doStreamLoad() returns Boolean.FALSE after a Stream Load HTTP round-trip whose reported status is not a success/commit state; flush() is invoked from write() when the batch buffer fills or from close() when the final batch is flushed.","commonSituations":"StarRocks returns a transient 'publish timeout' status; label state checks report a non-committed state; FE nodes under load reject or time out the load; wrong table schema causing 'Fail to get status' style responses.","solutions":["Inspect the StarRocks FE/BE logs for the label printed in the message to see the actual failure reason.","Increase sink max-retries and retry backoff options so transient publish timeouts are retried successfully.","Verify load_url points to reachable FE http ports and the database/table exist with a matching schema.","If errors persist, check disk space, BE status, and table replica health in StarRocks."],"exampleFix":"// before: few retries, transient publish timeouts fail\nsink = { max_retries = 1 }\n// after: allow retries for transient failures\nsink = { max_retries = 5, retry_backoff_multiplier_ms = 1000, max_retry_backoff_ms = 60000 }","handlingStrategy":"retry","validationCode":"// pre-check target availability before flush\ncurl -s http://<fe-host>:8030/api/<db>/_stream_load_2pc || echo 'FE unreachable'\nSHOW STREAM LOAD FROM <db>; // inspect recent label outcomes","typeGuard":null,"tryCatchPattern":"try {\n    sink.write(records);\n} catch (StarRocksConnectorException e) {\n    if (e.getErrorCode() == StarRocksConnectorErrorCode.FLUSH_DATA_FAILED) {\n        // inspect label state, decide re-flush or replay from checkpoint\n    }\n}","preventionTips":["Configure generous max-retries and exponential backoff for transient StarRocks states","Monitor FE/BE health so publish timeouts are caught before they hit the sink","Keep labels unique per checkpoint to avoid ambiguous duplicate-label outcomes"],"tags":["starrocks","stream-load","retry","sink"],"backgroundTag":"api-error-response","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"}