apache/seatunnel · error · SensorsDataException
EVENT_NAME_NOT_SET
EVENT_NAME_NOT_SET
Error message
Event name not set
What it means
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.
Source
Thrown at seatunnel-connectors-v2/connector-sensorsdata/src/main/java/org/apache/seatunnel/connectors/sensorsdata/format/record/RowAccessor.java:164
if (!unknownSourceFields.isEmpty()) {
String message =
String.format(
"Fields [%s] not found in source column",
String.join(", ", unknownSourceFields));
throw new SensorsDataException(SensorsDataErrorCode.UNKNOWN_SOURCE_FIELD, message);
}
}
public String getEventName(SeaTunnelRow row) {
if (eventName != null) {
return eventName;
}
if (eventColumnIndex != null) {
return (String) row.getField(eventColumnIndex);
}
throw new SensorsDataException(
SensorsDataErrorCode.EVENT_NAME_NOT_SET, "Event name not set");
}
public String getDistinctId(SeaTunnelRow row) {
Object distinctValue =
TypeUtil.toTargetType(
row.getField(this.distinctIdColumnIndex),
SensorsDataTypes.DataTypes.STRING);
if ((!config.isDistinctIdByIdentities())
|| (distinctValue != null && StringUtils.isNotBlank((String) distinctValue))) {
return (String) distinctValue;
}
// if the distinctId field is not obtained from the data, it needs to be supplemented with
// information from the identitity fields
return getDistinctId(getUserIdentities(row));
}
/**View on GitHub (pinned to cf67b549a7)
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.
Example fix
// before (config)
sink {
SensorsData {
record_type = "events"
# event_name missing -> EVENT_NAME_NOT_SET at runtime
}
}
// after
sink {
SensorsData {
record_type = "events"
event_name = "${event}" // or a literal: event_name = "track_purchase"
}
} Defensive patterns
Strategy: validation
Validate before calling
// before submitting the job config
if (recordType == "events" && (eventName == null || eventName.isBlank())) {
throw new IllegalArgumentException(
"event_name is required when record_type=events (literal or ${column})");
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- MISSING_NECESSARY_FIELD
- UNSUPPORTED_RECORD_TYPE
- PostHog option 'base_url' must not be blank
- PostHog option '${optionName}' must not be blank
- ILLEGAL_ARGUMENT
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/8e4b0edf9af9ea65.
Report an issue: GitHub.