apache/seatunnel · error · IllegalArgumentException

input.output-format.type must be "line" or "json".

Error message

input.output-format.type must be "line" or "json".

What it means

input.output-format.type selects how each collected item is emitted: as a raw "line" or a parsed "json" object. FileCollectConfig.validateOutputType accepts only these two values (case-insensitive) and throws this IllegalArgumentException for anything else.

Source

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

        return !"fail".equalsIgnoreCase(onError);
    }

    private static void validateOnError(String value) {
        if (!value.equalsIgnoreCase("skip") && !value.equalsIgnoreCase("fail")) {
            throw new IllegalArgumentException("input.on-error must be \"skip\" or \"fail\".");
        }
    }

    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. Set input.output-format.type to "line" for raw line emission
  2. Set input.output-format.type to "json" for parsed-JSON output
  3. Check spelling — the validator is case-insensitive but exact-word only

Example fix

# before
input.output-format.type = "text"
# after
input.output-format.type = "line"
Defensive patterns

Strategy: validation

Validate before calling

String type = cfg.get(FileCollectOptions.OUTPUT_FORMAT_TYPE);
if (!"line".equalsIgnoreCase(type) && !"json".equalsIgnoreCase(type)) { throw new IllegalArgumentException("output-format.type must be line or json"); }

Try / catch

try { FileCollectConfig.from(config); } catch (IllegalArgumentException e) { log.error("output-format.type invalid: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Setting input.output-format.type to values like "text", "raw", "string", "ndjson", or a mistyped value.

Common situations: Users expecting auto-detection of JSON output, or copying option names from other connectors with different format vocabularies.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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