apache/seatunnel · error · IllegalArgumentException

Unsupported original_data_format=

Error message

Unsupported original_data_format='%s'. Current version only supports TEXT.

What it means

IllegalArgumentException from ErrorHandlerConfigUtil.buildStageConfig when original_data_format is set to anything other than TEXT. The current implementation only supports rendering the original bad row as plain text, so other formats (e.g. JSON) are rejected up front.

Solutions

  1. Set original_data_format = "TEXT" (the only supported value).
  2. Remove the original_data_format key to accept the default TEXT.
  3. If structured error output is needed, post-process the error sink output yourself.

Example fix

// before
error-handler { original_data_format = "JSON" }
// after
error-handler { original_data_format = "TEXT" }
Defensive patterns

Strategy: validation

Validate before calling

String f = config.getString("original_data_format");
if (f != null && !"TEXT".equalsIgnoreCase(f)) throw new IllegalArgumentException("only TEXT supported, got " + f);

Try / catch

try { buildStageConfig(stage, global); } catch (IllegalArgumentException e) { if (e.getMessage().contains("original_data_format")) { setFormatToText(); } }

Prevention

When it happens

Trigger: Setting env.error-handler.original_data_format (global or stage) to a value other than TEXT (case-insensitive), e.g. "JSON".

Common situations: Users expecting structured JSON error payloads; docs/examples from other systems offering multiple formats; forward-looking config written for a planned feature.

Related errors


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

Appendix: source

Thrown at seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/error/ErrorHandlerConfigUtil.java:94

                        "max_error_ratio_min_records",
                        DEFAULT_MAX_ERROR_RATIO_MIN_RECORDS);
        long maxErrorRecords = getLong(stage, global, "max_error_records", 0L);
        if (maxErrorRecords < 0L) {
            throw new IllegalArgumentException(
                    "error handler max_error_records must be non-negative, but was "
                            + maxErrorRecords);
        }

        int queueCapacity = getNonNegativeInt(stage, global, "queue_capacity", 10000);
        String overflowStr = getString(stage, global, "queue_overflow_policy", "FAIL");
        QueueOverflowPolicy overflowPolicy = QueueOverflowPolicy.fromString(overflowStr);

        boolean includeStacktrace = getBoolean(stage, global, "include_stacktrace", false);
        boolean includeOriginalData = getBoolean(stage, global, "include_original_data", false);

        String dataFormatStr = getString(stage, global, "original_data_format", "TEXT");
        if (!"TEXT".equalsIgnoreCase(dataFormatStr)) {
            throw new IllegalArgumentException(
                    "Unsupported original_data_format='"
                            + dataFormatStr
                            + "'. Current version only supports TEXT.");
        }
        OriginalDataFormat originalDataFormat = OriginalDataFormat.TEXT;

        int originalDataMaxLength =
                getNonNegativeInt(stage, global, "original_data_max_length", 8192);

        ErrorSinkConfig sinkConfig = buildErrorSinkConfig(stage, global);

        if (mode == ErrorHandlerMode.ROUTE && (sinkConfig == null || !sinkConfig.isConfigured())) {
            throw new IllegalArgumentException(
                    String.format(
                            "env.%s.mode=ROUTE requires env.%s.sink.plugin_name to be configured.",
                            stageKey, stageKey));
        }

View on GitHub (pinned to cf67b549a7)