apache/seatunnel · error · IllegalArgumentException

input.encoding is not supported: ${encodingName} (input id=$

Error message

input.encoding is not supported: ${encodingName} (input id=${inputId})

What it means

FileCollectConfig.resolveCharset validates input.encoding via Charset.forName. If the name is malformed (IllegalCharsetNameException) or not supported by the JVM (UnsupportedCharsetException), it wraps the cause in this IllegalArgumentException naming the encoding and the input id.

Source

Thrown at seatunnel-edge-agent/seatunnel-edge-agent-connector/src/main/java/org/apache/seatunnel/edge/agent/connector/config/FileCollectConfig.java:157

    private static void validateMultilineMatch(String value) {
        if (!value.equalsIgnoreCase("after") && !value.equalsIgnoreCase("before")) {
            throw new IllegalArgumentException(
                    "input.multiline.match must be \"after\" or \"before\".");
        }
    }

    private static void validateOutputType(String value) {
        if (!value.equalsIgnoreCase("line") && !value.equalsIgnoreCase("json")) {
            throw new IllegalArgumentException(
                    "input.output-format.type must be \"line\" or \"json\".");
        }
    }

    private static Charset resolveCharset(String encodingName, String inputId) {
        try {
            return Charset.forName(encodingName);
        } catch (IllegalCharsetNameException | UnsupportedCharsetException e) {
            throw new IllegalArgumentException(
                    "input.encoding is not supported: "
                            + encodingName
                            + " (input id="
                            + inputId
                            + ")",
                    e);
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Use a canonical IANA charset name the JVM supports: "UTF-8", "ISO-8859-1", "US-ASCII", "UTF-16"
  2. Call Charset.isSupported(name) before deploying the config
  3. Read the wrapped cause (IllegalCharsetNameException vs UnsupportedCharsetException) to distinguish syntax errors from genuinely missing charsets

Example fix

# before
input.encoding = "utf8"
# after
input.encoding = "UTF-8"
Defensive patterns

Strategy: validation

Validate before calling

String enc = cfg.get(FileCollectOptions.ENCODING);
if (!Charset.isSupported(enc)) { throw new IllegalArgumentException("input.encoding not supported: " + enc); }

Type guard

boolean isValidCharset(String name) { try { java.nio.charset.Charset.forName(name); return true; } catch (Exception e) { return false; } }

Try / catch

try { FileCollectConfig.from(config); } catch (IllegalArgumentException e) { log.error("Encoding rejected: {}", e.getMessage(), e.getCause()); }

Prevention

When it happens

Trigger: input.encoding set to a typo ("utf8", "UTF_8"), an alias the JVM does not know, or an empty/whitespace string.

Common situations: Using non-canonical charset names assumed valid, running on a JVM without an extended charset provider, or encoding values inherited from OS locale settings.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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