apache/seatunnel · error · SelectDBConnectorException

COMMIT_FAILED

COMMIT_FAILED

Error message

commit failed with SQL: " + copySQL + " Commit error with status: " + statusCode + ", Reason: " + reasonPhrase + ", Response: " + loadResult

What it means

Thrown by CopySQLUtil.copyFileToDatabase (selectdb-cloud connector) after all retries when the COPY INTO commit fails. The message includes the executed copy SQL, the HTTP status code, the reason phrase, and the response body returned by the SelectDB/Doris FE.

Solutions

  1. Check the embedded status, reason, and response in the message for the server's specific error
  2. Verify the target database/table exist and the SQL syntax is valid against SelectDB/Doris
  3. Confirm the SelectDB FE/BE nodes are healthy and reachable from the connector host
  4. Check user privileges for the LOAD/COPY operation and retry after fixing the cause
  5. Increase retries or investigate network instability if failures are transient

Example fix

// before
COPY INTO db.wrong_table FROM ...
// after
COPY INTO db.sales_orders (id, amount) FROM ...
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check target table and cluster health
// curl http://<fe>:8030/api/show_data?db=<db>
// SHOW CREATE TABLE db.tbl; -- verify table and privileges

Try / catch

try {
    CopySQLUtil.copyFileToDatabase(...);
} catch (SelectDBConnectorException e) {
    log.error("COPY commit failed: {}", e.getMessage()); // SQL, status, body embedded
    // inspect FE health then decide: fix SQL / restart load
    throw e;
}

Prevention

When it happens

Trigger: Submitting the COPY SQL to load staged file data and receiving a non-success HTTP status every retry, e.g. FE unreachable (connection error -> non-200), SQL parse errors, wrong label/database/table, or load failures inside the copy response.

Common situations: SelectDB/Doris cluster down or FE overloaded during load; malformed COPY SQL (bad table/column list); non-existent target database/table; insufficient privileges; all configured retries exhausted with persistent failure.

Understand the failure class

Background: "query failed", "%w: SQL error" — wrapped database query errors in Go libraries explained — this error's family across 3 libraries.

Related errors


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

Appendix: source

Thrown at seatunnel-connectors-v2/connector-selectdb-cloud/src/main/java/org/apache/seatunnel/connectors/selectdb/rest/CopySQLUtil.java:99

                        hostPort,
                        reasonPhrase);
            } else if (response.getEntity() != null) {
                loadResult = EntityUtils.toString(response.getEntity());
                success = handleCommitResponse(loadResult);
                if (success) {
                    log.info(
                            "commit success cost {}ms, response is {}",
                            System.currentTimeMillis() - start,
                            loadResult);
                    break;
                } else {
                    log.warn("commit failed, retry again");
                }
            }
        }

        if (!success) {
            throw new SelectDBConnectorException(
                    SelectDBConnectorErrorCode.COMMIT_FAILED,
                    "commit failed with SQL: "
                            + copySQL
                            + " Commit error with status: "
                            + statusCode
                            + ", Reason: "
                            + reasonPhrase
                            + ", Response: "
                            + loadResult);
        }
    }

    private static boolean handleCommitResponse(String loadResult) throws IOException {
        BaseResponse<CopyIntoResp> baseResponse =
                OBJECT_MAPPER.readValue(
                        loadResult, new TypeReference<BaseResponse<CopyIntoResp>>() {});
        if (baseResponse.getCode() == LoadStatus.SUCCESS) {
            CopyIntoResp dataResp = baseResponse.getData();

View on GitHub (pinned to cf67b549a7)