{"record":{"id":"8e4b0edf9af9ea65","repo":"apache/seatunnel","slug":"event-name-not-set","errorCode":"EVENT_NAME_NOT_SET","errorMessage":"Event name not set","messagePattern":"Event name not set","errorType":"error_code","errorClass":"SensorsDataException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-sensorsdata/src/main/java/org/apache/seatunnel/connectors/sensorsdata/format/record/RowAccessor.java","lineNumber":164,"sourceCode":"        if (!unknownSourceFields.isEmpty()) {\n            String message =\n                    String.format(\n                            \"Fields [%s] not found in source column\",\n                            String.join(\", \", unknownSourceFields));\n            throw new SensorsDataException(SensorsDataErrorCode.UNKNOWN_SOURCE_FIELD, message);\n        }\n    }\n\n    public String getEventName(SeaTunnelRow row) {\n        if (eventName != null) {\n            return eventName;\n        }\n\n        if (eventColumnIndex != null) {\n            return (String) row.getField(eventColumnIndex);\n        }\n\n        throw new SensorsDataException(\n                SensorsDataErrorCode.EVENT_NAME_NOT_SET, \"Event name not set\");\n    }\n\n    public String getDistinctId(SeaTunnelRow row) {\n        Object distinctValue =\n                TypeUtil.toTargetType(\n                        row.getField(this.distinctIdColumnIndex),\n                        SensorsDataTypes.DataTypes.STRING);\n        if ((!config.isDistinctIdByIdentities())\n                || (distinctValue != null && StringUtils.isNotBlank((String) distinctValue))) {\n            return (String) distinctValue;\n        }\n        // if the distinctId field is not obtained from the data, it needs to be supplemented with\n        // information from the identitity fields\n        return getDistinctId(getUserIdentities(row));\n    }\n\n    /**","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-sensorsdata/src/main/java/org/apache/seatunnel/connectors/sensorsdata/format/record/RowAccessor.java#L146-L182","documentation":"RowAccessor.getEventName() resolves the SensorsData event name either from a static 'event_name' config value or, when written as '${column}', from the row field at the configured column index. The connector throws SensorsDataException(EVENT_NAME_NOT_SET) only when BOTH sources are unset, which happens when the event_name config is blank: initEventNameConfig() returns early on a blank value, leaving eventName=null and eventColumnIndex=null. Without an event name, no event record can be constructed for the Sensors Data API.","triggerScenarios":"Writing record_type=events (USER_EVENT) while the event_name option is absent, empty, or whitespace-only in the SeaTunnel job config; buildUserEventRecord() calls rowAccessor.getEventName(row) per row and immediately throws.","commonSituations":"User copies an event-sink config template and deletes event_name thinking it is optional; a typo like event-name is silently ignored (unknown keys are not rejected), so getEventName() behaves as if unset; config was migrated from a user-profile sink (record_type=users) that legitimately has no event_name and then switched to events without adding it.","solutions":["Set the event_name option in the sink config, either to a literal name (event_name = \"login\") or to a source column reference (event_name = \"${event}\"), then rerun the job.","If the event name should vary per row, verify the ${column} syntax is exact: '${' + column name + '}', and that the column exists in the source schema (otherwise a different UNKNOWN_SOURCE_FIELD error appears at startup).","Check for misspelled option keys (event_name must match exactly); a blank/absent key is what leaves both eventName and eventColumnIndex null.","If you are not sending events, confirm record_type is users/details rather than events, since only event records require an event name."],"exampleFix":"// before (config)\nsink {\n  SensorsData {\n    record_type = \"events\"\n    # event_name missing -> EVENT_NAME_NOT_SET at runtime\n  }\n}\n// after\nsink {\n  SensorsData {\n    record_type = \"events\"\n    event_name = \"${event}\"   // or a literal: event_name = \"track_purchase\"\n  }\n}","handlingStrategy":"validation","validationCode":"// before submitting the job config\nif (recordType == \"events\" && (eventName == null || eventName.isBlank())) {\n    throw new IllegalArgumentException(\n        \"event_name is required when record_type=events (literal or ${column})\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair record_type=events with an event_name (literal or ${column}) in the sink config.","Keep option key spelling exact; unknown keys are ignored silently.","When switching a sink from users to events, re-audit all required options (event_name, schema).","Test the config with a small batch job before running production pipelines."],"tags":["sensorsdata","seatunnel","config","events"],"backgroundTag":"missing-required-config-field","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}