{"record":{"id":"7a103edf4f90aed8","repo":"apache/seatunnel","slug":"error-while-loading-data","errorCode":null,"errorMessage":"error while loading data.","messagePattern":"error while loading data\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/sink/writer/DorisSinkWriter.java","lineNumber":339,"sourceCode":"        // the load future is done and checked in prepareCommit().\n        // this will check error while loading.\n        String errorMsg;\n        log.debug(\"start timer checker, interval {} ms\", intervalTime);\n        if ((errorMsg = dorisStreamLoad.getLoadFailedMsg()) != null) {\n            log.error(\"stream load finished unexpectedly: {}\", errorMsg);\n            loadException =\n                    new DorisConnectorException(\n                            DorisConnectorErrorCode.STREAM_LOAD_FAILED, errorMsg);\n            // Stop the scheduler to prevent repeated error logging when downstream is unavailable.\n            // Once loadException is set, write() will throw on the next call via\n            // checkLoadException().\n            scheduledExecutorService.shutdownNow();\n        }\n    }\n\n    private void checkLoadException() {\n        if (loadException != null) {\n            throw new RuntimeException(\"error while loading data.\", loadException);\n        }\n    }\n\n    @Override\n    public void close() throws IOException {\n        if (!dorisSinkConfig.getEnable2PC()) {\n            flush();\n        }\n        if (scheduledExecutorService != null) {\n            scheduledExecutorService.shutdownNow();\n        }\n        if (dorisStreamLoad != null) {\n            dorisStreamLoad.close();\n        }\n        if (controlStreamLoad != null && controlStreamLoad != dorisStreamLoad) {\n            controlStreamLoad.close();\n        }\n    }","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/sink/writer/DorisSinkWriter.java#L321-L357","documentation":"checkLoadException rethrows an asynchronous load failure stored in the loadException field as a plain RuntimeException('error while loading data.'). Stream loads run async via pendingLoadFuture; failures captured by the async callback are surfaced at the next write() or timerFlush().","triggerScenarios":"The async stream load (DorisStreamLoad future) failed (network error, HTTP error, response parse failure), the callback recorded loadException, and the next call to write() or timerFlush() invokes checkLoadException().","commonSituations":"BE node down mid-load; HTTP timeouts under load; unexpected response body breaking RespContent parsing; label conflicts surfaced asynchronously.","solutions":["Inspect the cause (loadException) attached to the RuntimeException for the root error","Check Doris BE/FE health and network reachability from the worker","Review job logs for the original async failure message","Retry the job from the last checkpoint; enable 2PC for exactly-once recovery"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { writer.write(row); } catch (RuntimeException e) { if (\"error while loading data.\".equals(e.getMessage()) && e.getCause() != null) { log.error(\"async load root cause\", e.getCause()); } throw e; }","preventionTips":["Always inspect getCause() — the real failure is asynchronous","Monitor BE/FE health; async failures usually stem from node or network issues","Enable checkpoints/2PC so failures resume cleanly","Keep http timeouts generous enough for large batches"],"tags":["doris","stream-load","async"],"backgroundTag":"http-request-failed","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"}