apache/seatunnel · error · IllegalArgumentException

Option 'field_delimiter' cannot be empty

Error message

Option 'field_delimiter' cannot be empty

What it means

Thrown by GooglePubSubSourceConfig.from when the connector is built with format=TEXT but field_delimiter resolves to an empty string. The TEXT format splits message payloads on this delimiter, so an empty value would make parsing meaningless. This is an eager configuration validation to fail fast at source construction instead of at read time.

Source

Thrown at seatunnel-connectors-v2/connector-google-pubsub/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/pubsub/config/GooglePubSubSourceConfig.java:63

        String credentialsPath = config.get(GooglePubSubSourceOptions.CREDENTIALS_PATH);
        String emulatorHost = config.get(GooglePubSubSourceOptions.EMULATOR_HOST);
        MessageFormat format = config.get(GooglePubSubSourceOptions.FORMAT);
        String fieldDelimiter = config.get(GooglePubSubSourceOptions.FIELD_DELIMITER);
        Long maxOutstandingMessages =
                config.get(GooglePubSubSourceOptions.MAX_OUTSTANDING_MESSAGES);
        Long maxOutstandingBytes = config.get(GooglePubSubSourceOptions.MAX_OUTSTANDING_BYTES);
        Integer parallelPullCount = config.get(GooglePubSubSourceOptions.PARALLEL_PULL_COUNT);

        requireNonBlank(projectId, GooglePubSubSourceOptions.PROJECT_ID.key());
        requireNonBlank(subscription, GooglePubSubSourceOptions.SUBSCRIPTION.key());
        requireNonBlankIfPresent(credentialsPath, GooglePubSubSourceOptions.CREDENTIALS_PATH.key());
        requireNonBlankIfPresent(emulatorHost, GooglePubSubSourceOptions.EMULATOR_HOST.key());
        if (credentialsPath != null && emulatorHost != null) {
            throw new IllegalArgumentException(
                    "Options 'credentials_path' and 'emulator_host' cannot be configured together");
        }
        if (format == MessageFormat.TEXT && fieldDelimiter.isEmpty()) {
            throw new IllegalArgumentException("Option 'field_delimiter' cannot be empty");
        }
        requirePositive(
                maxOutstandingMessages, GooglePubSubSourceOptions.MAX_OUTSTANDING_MESSAGES.key());
        requirePositive(maxOutstandingBytes, GooglePubSubSourceOptions.MAX_OUTSTANDING_BYTES.key());
        requirePositive(parallelPullCount, GooglePubSubSourceOptions.PARALLEL_PULL_COUNT.key());

        return GooglePubSubSourceConfig.builder()
                .projectId(projectId)
                .subscription(subscription)
                .credentialsPath(credentialsPath)
                .emulatorHost(emulatorHost)
                .format(format)
                .fieldDelimiter(fieldDelimiter)
                .maxOutstandingMessages(maxOutstandingMessages)
                .maxOutstandingBytes(maxOutstandingBytes)
                .parallelPullCount(parallelPullCount)
                .build();
    }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set a non-empty field_delimiter (e.g. "," or "\t") in the source config when message_format = TEXT.
  2. If no delimiter splitting is desired, switch message_format to JSON instead of TEXT.
  3. Verify no environment-variable or placeholder expansion is blanking the field_delimiter value before it reaches the connector.

Example fix

// before
field_delimiter = ""
message_format = TEXT
// after
field_delimiter = ","
message_format = TEXT
Defensive patterns

Strategy: validation

Validate before calling

String delimiter = config.get("field_delimiter");
String format = config.get("message_format");
if ("text".equalsIgnoreCase(format) && (delimiter == null || delimiter.isEmpty())) {
    throw new IllegalArgumentException("field_delimiter must be non-empty when message_format is TEXT");
}

Prevention

When it happens

Trigger: Calling GooglePubSubSourceConfig.from (directly or via the SeaTunnel source factory) with GooglePubSubSourceOptions.MESSAGE_FORMAT set to TEXT and GooglePubSubSourceOptions.FIELD_DELIMITER set to an empty string "".

Common situations: Users set field_delimiter = "" in the HOCON config to try to disable delimiter-based splitting, or a template/variable interpolation yields an empty value while message_format is TEXT.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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