{"record":{"id":"dcf234c1f3b8b623","repo":"apache/seatunnel","slug":"send-record-failed","errorCode":"SEND_RECORD_FAILED","errorMessage":"e.getMessage()","messagePattern":"e\\.getMessage\\(\\)","errorType":"error_code","errorClass":"SensorsDataConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-sensorsdata/src/main/java/org/apache/seatunnel/connectors/sensorsdata/sdk/sink/SensorsDataSDKWriter.java","lineNumber":142,"sourceCode":"                            ((UserDetailRecord) recordBuilder.build(row)).getUserDetailSchema());\n                    break;\n                case SPECIAL_ITEM:\n                    sa.itemSet(((SpecialItemRecord) recordBuilder.build(row)).getItemRecord());\n                    break;\n                default:\n                    throw new SensorsDataConnectorException(\n                            SensorsDataConnectorErrorCode.UNSUPPORTED_RECORD_TYPE,\n                            \"Unsupported record type\");\n            }\n        } catch (Exception e) {\n            log.error(\"Write error\", e);\n            log.error(\n                    \"Write error, SeaTunnelRow#tableId={} SeaTunnelRow#kind={} : [{}]\",\n                    row.getTableId(),\n                    row.getRowKind(),\n                    fieldsToString(row));\n            if (!isSkipErrorRecord) {\n                throw new SensorsDataConnectorException(\n                        SensorsDataConnectorErrorCode.SEND_RECORD_FAILED, e.getMessage(), e);\n            }\n        }\n    }\n\n    /** Convert the SeaTunnelRow data to a string */\n    private String fieldsToString(SeaTunnelRow row) {\n        String[] arr = new String[seaTunnelRowType.getTotalFields()];\n        SeaTunnelDataType<?>[] fieldTypes = seaTunnelRowType.getFieldTypes();\n        Object[] fields = row.getFields();\n        for (int i = 0; i < fieldTypes.length; i++) {\n            arr[i] = fieldToString(fieldTypes[i], fields[i]);\n        }\n        return StringUtils.join(arr, \", \");\n    }\n\n    /** copy from ConsoleSinkWriter */\n    private String fieldToString(SeaTunnelDataType<?> type, Object value) {","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-sensorsdata/src/main/java/org/apache/seatunnel/connectors/sensorsdata/sdk/sink/SensorsDataSDKWriter.java#L124-L160","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the cause chain (the original exception is preserved as cause) to find the root failure — validation vs network.","If it is a data validation problem, fix the offending column values or mappings shown in the logged 'Write error, SeaTunnelRow#tableId=...' line.","If it is a send/network failure, verify server_url is reachable and the receiving service is healthy.","Set skip_error_record = true only if you intentionally want bad rows logged and skipped instead of failing the job."],"exampleFix":"// before: job fails on one bad row\nskip_error_record = false\n// after: log-and-skip bad rows (use with monitoring)\nskip_error_record = true","handlingStrategy":"try-catch","validationCode":"// pre-flight: verify server reachability\nHttpURLConnection c = (HttpURLConnection) new URL(serverUrl).openConnection();\nc.setConnectTimeout(5000);\nif (c.getResponseCode() >= 400) throw new IllegalStateException(\"SensorsData server unreachable\");","typeGuard":null,"tryCatchPattern":"try {\n    writer.write(row);\n} catch (SensorsDataConnectorException e) {\n    if (SensorsDataConnectorErrorCode.SEND_RECORD_FAILED.equals(e.getErrorCode()) && isTransient(e.getCause())) {\n        retryWrite(row); // bounded retries with backoff\n    } else {\n        throw e;\n    }\n}","preventionTips":["Set skip_error_record=true with alerting if occasional bad rows are acceptable.","Read the cause chain to distinguish validation vs network failures.","Monitor the 'Write error' logs for recurring bad-field patterns.","Verify server_url connectivity before running production jobs."],"tags":["sensorsdata","write-failure","sink"],"backgroundTag":"upstream-api-error","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"}