apache/seatunnel · error

GetNext result from {} is null.

Error message

GetNext result from {} is null.

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/backend/BackendClient.java:182

     * get next row batch from Doris BE
     *
     * @param nextBatchParams thrift struct to required by request
     * @return scan batch result
     * @throws DorisConnectorException throw if cannot connect to Doris BE
     */
    public TScanBatchResult getNext(TScanNextBatchParams nextBatchParams) {
        log.debug("GetNext to '{}', parameter is '{}'.", routing, nextBatchParams);
        if (!isConnected) {
            open();
        }
        TException ex = null;
        TScanBatchResult result = null;
        for (int attempt = 0; attempt < retries; ++attempt) {
            log.debug("Attempt {} to getNext {}.", attempt, routing);
            try {
                result = client.getNext(nextBatchParams);
                if (result == null) {
                    log.warn("GetNext result from {} is null.", routing);
                    continue;
                }
                if (!TStatusCode.OK.equals(result.getStatus().getStatusCode())) {
                    log.warn(
                            "The status of get next result from {} is '{}', error message is: {}.",
                            routing,
                            result.getStatus().getStatusCode(),
                            result.getStatus().getErrorMsgs());
                    continue;
                }
                return result;
            } catch (TException e) {
                log.warn("Get next from {} failed.", routing, e);
                ex = e;
            }
        }
        if (result != null && (TStatusCode.OK != (result.getStatus().getStatusCode()))) {
            log.error(

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check BE logs for scan-context cancellation/expiry errors at that timestamp.
  2. Retry the job; transient BE issues often resolve.
  3. Reduce doris.request.batch-size / increase read timeout so batches finish before context expiry.
  4. Verify connector/Doris version compatibility.
  5. Check tablet health and restart/repair failing BE nodes.
Defensive patterns

Strategy: retry

Validate before calling

// keep batch reads short so the BE scan context does not expire
// doris.request.batch-size small enough; BE scan context timeout generous enough

Try / catch

try {
    batch = scanner.getNext();
} catch (DorisConnectorException e) {
    // getNext returned null after all retries; scan context likely expired/invalid — restart the read
}

Prevention

When it happens

Trigger: 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.

Common situations: Slow reads where the BE scan context times out; BE restart during a long batch read; protocol/version mismatch; heavily loaded BE dropping responses.

Understand the failure class

Background: "invalid response format", "malformed payload", "missing data field": when an API returns 200 but the response shape is wrong — this error's family across 23 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/b72809c8d8cd6679. Report an issue: GitHub.