{"record":{"id":"b72809c8d8cd6679","repo":"apache/seatunnel","slug":"getnext-result-from-is-null","errorCode":null,"errorMessage":"GetNext result from {} is null.","messagePattern":"GetNext result from (.+?) is null\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/backend/BackendClient.java","lineNumber":182,"sourceCode":"     * get next row batch from Doris BE\n     *\n     * @param nextBatchParams thrift struct to required by request\n     * @return scan batch result\n     * @throws DorisConnectorException throw if cannot connect to Doris BE\n     */\n    public TScanBatchResult getNext(TScanNextBatchParams nextBatchParams) {\n        log.debug(\"GetNext to '{}', parameter is '{}'.\", routing, nextBatchParams);\n        if (!isConnected) {\n            open();\n        }\n        TException ex = null;\n        TScanBatchResult result = null;\n        for (int attempt = 0; attempt < retries; ++attempt) {\n            log.debug(\"Attempt {} to getNext {}.\", attempt, routing);\n            try {\n                result = client.getNext(nextBatchParams);\n                if (result == null) {\n                    log.warn(\"GetNext result from {} is null.\", routing);\n                    continue;\n                }\n                if (!TStatusCode.OK.equals(result.getStatus().getStatusCode())) {\n                    log.warn(\n                            \"The status of get next result from {} is '{}', error message is: {}.\",\n                            routing,\n                            result.getStatus().getStatusCode(),\n                            result.getStatus().getErrorMsgs());\n                    continue;\n                }\n                return result;\n            } catch (TException e) {\n                log.warn(\"Get next from {} failed.\", routing, e);\n                ex = e;\n            }\n        }\n        if (result != null && (TStatusCode.OK != (result.getStatus().getStatusCode()))) {\n            log.error(","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/backend/BackendClient.java#L164-L200","documentation":"BackendClient.getNext fetches the next scan batch from the Doris BE. If the RPC returns null it logs this warning and retries; after exhausting retries the method treats it as a failure (logging DORIS_INTERNAL_FAIL_MESSAGE / connect-failed errors and throwing). A null batch is an unexpected BE response shape indicating the scan stream is broken or the BE misbehaved.","triggerScenarios":"client.getNext(nextBatchParams) returns null on all retry attempts while streaming rows — usually because the scan context became invalid on the BE (scanner closed/expired) or a BE-side fault returns an empty payload.","commonSituations":"Slow reads where the BE scan context times out; BE restart during a long batch read; protocol/version mismatch; heavily loaded BE dropping responses.","solutions":["Check BE logs for scan-context cancellation/expiry errors at that timestamp.","Retry the job; transient BE issues often resolve.","Reduce doris.request.batch-size / increase read timeout so batches finish before context expiry.","Verify connector/Doris version compatibility.","Check tablet health and restart/repair failing BE nodes."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// keep batch reads short so the BE scan context does not expire\n// doris.request.batch-size small enough; BE scan context timeout generous enough","typeGuard":null,"tryCatchPattern":"try {\n    batch = scanner.getNext();\n} catch (DorisConnectorException e) {\n    // getNext returned null after all retries; scan context likely expired/invalid — restart the read\n}","preventionTips":["Finish reads within the BE scan context timeout; avoid long pauses between getNext calls.","Reduce batch size to shorten per-RPC duration.","Monitor BE health during long-running jobs.","Upgrade connector when upgrading Doris to keep the scan protocol in sync."],"tags":["thrift","doris","rpc","streaming","null-response"],"backgroundTag":"unexpected-api-response-shape","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"}