apache/seatunnel · error · SensorsDataConnectorException

SEND_RECORD_FAILED

SEND_RECORD_FAILED

Error message

e.getMessage()

What it means

When write(row) fails for any reason, SensorsDataSDKWriter wraps the underlying exception into SensorsDataConnectorException with code SEND_RECORD_FAILED, carrying e.getMessage() and the cause. This is the connector's generic write-failure signal: record building, SDK validation, and SDK send errors all funnel here. It is suppressed (record skipped, only logged) when skip_error_record=true.

Source

Thrown at seatunnel-connectors-v2/connector-sensorsdata/src/main/java/org/apache/seatunnel/connectors/sensorsdata/sdk/sink/SensorsDataSDKWriter.java:142

                            ((UserDetailRecord) recordBuilder.build(row)).getUserDetailSchema());
                    break;
                case SPECIAL_ITEM:
                    sa.itemSet(((SpecialItemRecord) recordBuilder.build(row)).getItemRecord());
                    break;
                default:
                    throw new SensorsDataConnectorException(
                            SensorsDataConnectorErrorCode.UNSUPPORTED_RECORD_TYPE,
                            "Unsupported record type");
            }
        } catch (Exception e) {
            log.error("Write error", e);
            log.error(
                    "Write error, SeaTunnelRow#tableId={} SeaTunnelRow#kind={} : [{}]",
                    row.getTableId(),
                    row.getRowKind(),
                    fieldsToString(row));
            if (!isSkipErrorRecord) {
                throw new SensorsDataConnectorException(
                        SensorsDataConnectorErrorCode.SEND_RECORD_FAILED, e.getMessage(), e);
            }
        }
    }

    /** Convert the SeaTunnelRow data to a string */
    private String fieldsToString(SeaTunnelRow row) {
        String[] arr = new String[seaTunnelRowType.getTotalFields()];
        SeaTunnelDataType<?>[] fieldTypes = seaTunnelRowType.getFieldTypes();
        Object[] fields = row.getFields();
        for (int i = 0; i < fieldTypes.length; i++) {
            arr[i] = fieldToString(fieldTypes[i], fields[i]);
        }
        return StringUtils.join(arr, ", ");
    }

    /** copy from ConsoleSinkWriter */
    private String fieldToString(SeaTunnelDataType<?> type, Object value) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Read the cause chain (the original exception is preserved as cause) to find the root failure — validation vs network.
  2. If it is a data validation problem, fix the offending column values or mappings shown in the logged 'Write error, SeaTunnelRow#tableId=...' line.
  3. If it is a send/network failure, verify server_url is reachable and the receiving service is healthy.
  4. Set skip_error_record = true only if you intentionally want bad rows logged and skipped instead of failing the job.

Example fix

// before: job fails on one bad row
skip_error_record = false
// after: log-and-skip bad rows (use with monitoring)
skip_error_record = true
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-flight: verify server reachability
HttpURLConnection c = (HttpURLConnection) new URL(serverUrl).openConnection();
c.setConnectTimeout(5000);
if (c.getResponseCode() >= 400) throw new IllegalStateException("SensorsData server unreachable");

Try / catch

try {
    writer.write(row);
} catch (SensorsDataConnectorException e) {
    if (SensorsDataConnectorErrorCode.SEND_RECORD_FAILED.equals(e.getErrorCode()) && isTransient(e.getCause())) {
        retryWrite(row); // bounded retries with backoff
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Any exception thrown inside write(row) — SDK InvalidArgumentException from record building, network/send errors from the Sensors BatchConsumer, or the UNSUPPORTED_RECORD_TYPE guard — when skip_error_record is false.

Common situations: Invalid row data failing SDK validation; SensorsData server unreachable or rejecting batches; misconfigured record type; transient network problems during bulk sends to the receiving endpoint.

Related errors


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