{"record":{"id":"967c42bd907a3cdd","repo":"apache/seatunnel","slug":"unknown-compression-value","errorCode":null,"errorMessage":"Unknown compression: ${value}","messagePattern":"Unknown compression: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-edge-agent/seatunnel-edge-agent-transport/src/main/java/org/apache/seatunnel/edge/agent/transport/packet/EdgePacketCompressionType.java","lineNumber":44,"sourceCode":"    ZLIB(\"zlib\"),\n    DEFLATE(\"deflate\");\n\n    private final String value;\n\n    EdgePacketCompressionType(String value) {\n        this.value = value;\n    }\n\n    public static EdgePacketCompressionType from(String value) {\n        if (value == null || value.isEmpty()) {\n            return NONE;\n        }\n        for (EdgePacketCompressionType t : values()) {\n            if (t.value.equalsIgnoreCase(value)) {\n                return t;\n            }\n        }\n        throw new IllegalArgumentException(\"Unknown compression: \" + value);\n    }\n}\n","sourceCodeStart":26,"sourceCodeEnd":47,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-edge-agent/seatunnel-edge-agent-transport/src/main/java/org/apache/seatunnel/edge/agent/transport/packet/EdgePacketCompressionType.java#L26-L47","documentation":"EdgePacketCompressionType.from performs a case-insensitive lookup of the given string over the enum's known values (e.g. NONE, GZIP, ZLIB, DEFLATE). If no constant matches, it throws IllegalArgumentException reporting the unknown value. It is called when reading transport packet compression config.","triggerScenarios":"Configuring packet compression with a string not among the enum values, e.g. \"snappy\", \"lz4\", \"zip\", or \"gzip\" misspelled as \"gzp\"; lookup is case-insensitive so case alone never triggers it.","commonSituations":"Copying compression names from another product (Snappy/LZ4 users); assuming \"zip\" maps to zlib; typos; an older build lacking a newly introduced enum value used in a newer config file.","solutions":["Set the compression value to one of the supported enum values, e.g. \"none\", \"gzip\", \"zlib\", or \"deflate\".","Check the enum source (EdgePacketCompressionType) for the exact accepted literals for your version.","If you need an unsupported algorithm (snappy/lz4), it is not available — choose the closest supported one or request the feature.","Align the config file with the agent version deployed; a newer enum value on an older binary will not resolve."],"exampleFix":"// before\ntransport.packet-compression = \"snappy\"\n\n// after\ntransport.packet-compression = \"gzip\"","handlingStrategy":"type-guard","validationCode":"String compression = cfg.getString(\"transport.packet-compression\");\nSet<String> allowed = Set.of(\"none\", \"gzip\", \"zlib\", \"deflate\");\nif (!allowed.contains(compression.trim().toLowerCase(Locale.ROOT))) {\n    throw new IllegalStateException(\"Unsupported packet-compression: \" + compression);\n}","typeGuard":"boolean isKnownCompression(String v) {\n    return v != null && (\"none\".equalsIgnoreCase(v) || \"gzip\".equalsIgnoreCase(v)\n        || \"zlib\".equalsIgnoreCase(v) || \"deflate\".equalsIgnoreCase(v));\n}","tryCatchPattern":"try {\n    EdgePacketCompressionType type = EdgePacketCompressionType.from(value);\n} catch (IllegalArgumentException e) {\n    LOG.warn(\"Falling back to gzip; unknown compression: \" + value, e);\n    type = EdgePacketCompressionType.GZIP;\n}","preventionTips":["Keep a single source of truth for supported compression literals and generate docs from the enum.","Prefer 'gzip' when interoperating — it is the most portable option.","Match config values against the enum in CI config tests.","Pin the agent version and align config templates to it."],"tags":["config","enum","compression","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}