apache/seatunnel · error · IllegalArgumentException

Unknown encryption: ${value}

Error message

Unknown encryption: ${value}

What it means

EdgePacketEncryptionType.from performs a case-insensitive lookup over its enum constants (e.g. NONE, AES_GCM) and throws IllegalArgumentException when the supplied string matches none of them. It is used while parsing transport.encryption in EdgeTransportConfig.

Source

Thrown at seatunnel-edge-agent/seatunnel-edge-agent-transport/src/main/java/org/apache/seatunnel/edge/agent/transport/packet/EdgePacketEncryptionType.java:42

    NONE("none"),
    AES_GCM("aes_gcm");

    private final String value;

    EdgePacketEncryptionType(String value) {
        this.value = value;
    }

    public static EdgePacketEncryptionType from(String value) {
        if (value == null || value.isEmpty()) {
            return NONE;
        }
        for (EdgePacketEncryptionType t : values()) {
            if (t.value.equalsIgnoreCase(value)) {
                return t;
            }
        }
        throw new IllegalArgumentException("Unknown encryption: " + value);
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set transport.encryption to a supported value, e.g. "none" or "aes_gcm".
  2. Consult EdgePacketEncryptionType for the exact literals accepted by your build.
  3. Replace aliases like "aes-gcm"/"AES256GCM" with the canonical "aes_gcm".
  4. If a previously working value stopped resolving, check whether the agent version renamed the enum constant.

Example fix

// before
transport.encryption = "aes-gcm"

// after
transport.encryption = "aes_gcm"
Defensive patterns

Strategy: type-guard

Validate before calling

String encryption = cfg.getString("transport.encryption");
Set<String> allowed = Set.of("none", "aes_gcm");
if (!allowed.contains(encryption.trim().toLowerCase(Locale.ROOT))) {
    throw new IllegalStateException("Unsupported transport.encryption: " + encryption);
}

Type guard

boolean isKnownEncryption(String v) {
    return v != null && ("none".equalsIgnoreCase(v) || "aes_gcm".equalsIgnoreCase(v));
}

Try / catch

try {
    EdgePacketEncryptionType type = EdgePacketEncryptionType.from(value);
} catch (IllegalArgumentException e) {
    LOG.warn("Falling back to none; unknown encryption: " + value, e);
    type = EdgePacketEncryptionType.NONE;
}

Prevention

When it happens

Trigger: Setting transport.encryption to a string other than the supported values, e.g. "aes", "aes256-gcm", "tls", or "AES-GCM" with a hyphen; case differences are tolerated, wrong spelling/algorithm is not.

Common situations: Guessing algorithm names from other libraries; writing "aes-gcm" instead of "aes_gcm"; a config template from a different project; a version where an encryption mode was renamed or removed.

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/fa89cd7f92559e4e. Report an issue: GitHub.